Closed Thread Icon

Preserved Topic: Can 1 link affect 2 different frames? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=17847" title="Pages that link to Preserved Topic: Can 1 link affect 2 different frames? (Page 1 of 1)" rel="nofollow" >Preserved Topic: Can 1 link affect 2 different frames? <span class="small">(Page 1 of 1)</span>\

 
riddim
Nervous Wreck (II) Inmate

From:
Insane since: Aug 2000

posted posted 08-29-2000 01:57

In a Flash menu in a frame I've assigned the following actions below to a button so when its clicked both the 'top' and 'main' frames are changed.

on (release) {
getURL ("mainvideos.html", "main");
getURL ("topvideos.html", "top");
}

Am planning to make a html only version of this same menu so is there any html or javascript code that can be assigned to a menu image and/or text so when a link is clicked 2 different frames are changed.

[This message has been edited by riddim (edited 29-08-2000).]

la'dsasha
Neurotic (0) Inmate
Newly admitted
posted posted 08-29-2000 02:13

i pulled this out of o'riley's web design in a nutshell:

code:
<script language="javascript">
<!--
function changePages(toolbarURL, mainURL) {
parent.toolbar.location.href=toolbarURL; parent.main.location.href=mainURL;
}
//-->
</script>

<a href="javascript:changePages('toolbar_document2.html','main_document2.html');">



im no flash expert (learning a bit here and there), but wouldnt you need to use the FS Command?

riddim
Nervous Wreck (II) Inmate

From:
Insane since: Aug 2000

posted posted 08-29-2000 02:34

Trust me it works, in Flash geturl is all thats needed. Thanks for your help.

riddim
Nervous Wreck (II) Inmate

From:
Insane since: Aug 2000

posted posted 08-31-2000 14:48

There was a lil problem with the script above but I found another one which I tested and works. I even tried using 1 link with 3 frames and it worked.

<script language="JavaScript">
<!----hide
function change2()
{
parent.main.location="1stframe.htm";
parent.top.location="2ndrame.htm";
}
//------>
</script>
</head>
<body>
</p>
<a HREF="javascript:change2()">
<p>Change 2 Frames</a>

timothymcnulty
Neurotic (0) Inmate
Newly admitted
posted posted 08-31-2000 20:46

riddim, that is the same thing. the only difference is that the script la'dsasha gave you offers more versatility.

say you have 5 links on a page. each link is going to change the 2 frames content to a different page. with your script you would have to build 5 different functions to put under each link:

function button1()
{
parent.main.location="home.htm";
parent.top.location="home_tool.htm";
}

function button2()
{
parent.main.location="links.htm";
parent.top.location="links_tool.htm";
}

etc.

with the script la'dsasha gave you you just build one function and modify which page to go to in the anchor tag of your html:

<script language="javascript">

<!--
function changePages(toolbarURL, mainURL) {
parent.toolbar.location.href=toolbarURL;
parent.main.location.href=mainURL;
}
//-->
</script>

<a href="javascript:changePages('home_tool.html','home.html');">

<a href="javascript:changePages('links_tool.html','links.html');">

etc. for more links

in the function changePages(toolbarURL, mainURL), you are stating "toolbarURL" and "mainURL" as variables to be determined when the script is executed. when the script is executed inside of the <A> tag, it will search for the 2 values inside of the () in the changPages function and replace toolbarURL and mainURL with those.

hope that helps you to understand it a little more. i tested the script and had no problems with it, maybe there was a small typo in the version you did. good luck.

[This message has been edited by timothymcnulty (edited 31-08-2000).]

twItch^
Maniac (V) Mad Scientist

From: the west wing
Insane since: Aug 2000

posted posted 08-31-2000 21:21

la'dsasha ~ the FSCommand is almost completely useless in Flash now. Originally, it was used to send commands to whatever it was that was housing the SWF file (such as html, javascript, etc). Flash has become more detailed in it's getURL command that makes most of those references cumbersome. Pretty much the only use for FSCommand is "FSCommand ("fullscreen",true) which changes to a fullscreen. Not much past that. I'm writing a Gurusnetwork tutorial on actionscripting, and I'll go into more detail on it then...

riddim
Nervous Wreck (II) Inmate

From:
Insane since: Aug 2000

posted posted 08-31-2000 21:27

The 2 scripts are a lil similar but I tried out la'dsasha's but it gave me an error, I even re-tested it once more from the lil modification you made and I still got an error in IE5. You can try it out yourself and see whether it works perfectly. I modified the one u (tim) posted and pasted it below but changed minor details like the frame and webpage but basically its the same. As u said la'dsasha's would be more versatile of the 2 if it worked coz it would require less code. The other one I found worked with as many links as I gave it but it requires extra lines of code. It works though.

<script language="javascript">

<!--
function changePages(main.html, mainrealaudio.html) {
parent.main.location.href=main.html;
parent.bottom.location.href=mainrealaudio.html;
}
//-->
</script>

<a
href="javascript:changePages('main.html','mainrealaudio.html');">
<p>link 1</a>
<a href="javascript:changePages('main.html','mainrealaudio.html');">link 2</a>

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 08-31-2000 23:19

I don't use frames much so I don't know if this is right. However I think you may need to simply name your frames and then use those to refrence them in the script.


Walking the Earth like Kane

tea
Nervous Wreck (II) Inmate

From: Bern, Switzerland
Insane since: Aug 2000

posted posted 09-05-2000 01:54

you have dots in your parameternames, maybe thats the cause of those errors.
change them and it may :-) work?

function changePages(m, b) {
parent.main.location.href=m;
parent.top.location.href=b;
}

here you have main and top as frame names.


cu, tea

« BackwardsOnwards »

Show Forum Drop Down Menu