how can i make it so when someone clicks on a link, it loads the page in one iframe and changes the image in another?
Just add two getURLS that change the content of each iframe.
[AS]on (release){
getURL(“content1.html”, “iframeName1”);
getURL(“content2.html”, “iframeName2”);
}[/AS]
I’m not sure they mean in Flash…
Ah, I got to this thread through the new posts area, so I didn’t notice the section it was in.
In that case… You could probably set up a javascript function.
::gets to testing::
[edit]::wonders why the title says onrelease then::[/edit]
Alright I came up with a Javascript way…
Insert this code in between your <HEAD></HEAD> tags of your HTML file.
<SCRIPT LANGUAGE="JavaScript">
<!--
function changeBoth(win1Loc, win2Loc){
document.all.window1.src = win1Loc;
document.all.window2.src = win2Loc;
}
-->
</SCRIPT>
Now you can call the function like this…
<A HREF="JavaScript:void(0);" onClick="JavaScript:changeBoth('win1NewFile.html', 'win2NewFile.html')">Change Both</A>
[EDIT]WHY DOES IT KEEP CHANGING JAVASCRIPT TO ABOUT?!?!?!?!?![/EDIT]
Ok Ok, OF COURSE there has to be Netscape complications :sure:
I fixed that though. Since iframes are only supported by Netscape 6+ I went through the liberty of only browser checking for IE or NS6+, then calling different scripts.
<SCRIPT LANGUAGE="JavaScript">
<!--
function changeBoth(win1Loc, win2Loc){
var IE = document.all;
var NS = !document.all && document.getElementById;
if (IE) {
document.all.window1.src = win1Loc;
document.all.window2.src = win2Loc;
} else if (NS) {
frames['window1'].location.href = win1Loc;
frames['window2'].location.href = win2Loc;
}
}
-->
</SCRIPT>
That is the new script.
And Oh yeah, I forgot. This script assumes your Iframe names are window1 and window2.
This script SHOULD work in IE4+ and NS6+, but I never guarantee anything
Well, if you indeed did mean in Flash as my first post… then oh well, maybe this will help someone else out
*Originally posted by lostinbeta *
**Ok Ok, OF COURSE there has to be Netscape complications :sure: **
That’s exactly why I HATE using JavaScript, essentially you have to code everything twice.
*Originally posted by abzoid *
**That’s exactly why I HATE using JavaScript, essentially you have to code everything twice.**
Yeah, but it is the price to pay to be a scripter. I like what I do, even though I sometimes have to code for both browsers seperately.