FREAKNUT
01-12-2007, 04:33 PM
Alright, I've worked up my solution to the browser's back button. It covers linking and bookmarking as well. It works perfect in Firefox 1 (haven't tested 2 yet). It also sort of works in Opera, except everytime you click the back/forward button, it refreshes the whole movie. My biggest problem is that it doesn't work in IE, and I am now stuck. I need some help figuring out the issue, and it's difficult to explain it, so here's the link to it...
*Edit*(I just removed this link on 1/22/07 and will post it again at a later date)*Edit*
Please excuse my code...it's messy and I need to clean it up. Here's the copy of my ActionScript that I use to detect the URL change. It's also messy and needs cleaning up, but it works. The frame that it redirects to is the frame right before it, so it's a constant loop. import flash.external.ExternalInterface;
var myUrl:String = String(ExternalInterface.call("getHash", null));
if ( myUrl == "#home" and _root.link != 1 and _root.flag == 1 ) {
_root["item"+_root.link].gotoAndPlay("s2");
_root.item1.gotoAndPlay("s1");
_root.link = 1;
_root.linkhead = 1;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleHome");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#customsoftware" and _root.link != 2 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item2.gotoAndPlay("s1");
_root.link = 2;
_root.linkhead = 2;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleCustom");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#companyprofile" and _root.link != 3 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item3.gotoAndPlay("s1");
_root.link = 3;
_root.linkhead = 3;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleProfile");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#backup" and _root.link != 4 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item4.gotoAndPlay("s1");
_root.link = 4;
_root.linkhead = 4;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleBackup");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#serverhosting" and _root.link != 5 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item5.gotoAndPlay("s1");
_root.link = 5;
_root.linkhead = 5;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleServer");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#hardware" and _root.link != 6 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item6.gotoAndPlay("s1");
_root.link = 6;
_root.linkhead = 6;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleHardware");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#webdesign" and _root.link != 7 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item7.gotoAndPlay("s1");
_root.link = 7;
_root.linkhead = 7;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleDesign");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#webhosting" and _root.link != 8 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item8.gotoAndPlay("s1");
_root.link = 8;
_root.linkhead = 8;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleHosting");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if (myUrl == "null") {
gotoAndPlay("nohash");
} else {
gotoAndPlay("pagedetect");
}
If anyone can give me some advice as to the issue I'm having in IE, I would GREATLY appreciate it! I've been working on this for a while, and I've hit another dead spot. Just FYI...there are a few links I haven't coded in yet. All I've got working is the left navigation. Thanks a whole bunch!
*Edit* Hey, I forgot to add the scripting on my buttons. import flash.external.ExternalInterface;
ExternalInterface.call("postHash", "home");
ExternalInterface.call("postTitle", "Creative Software Solutions - Home");
*Edit*(I just removed this link on 1/22/07 and will post it again at a later date)*Edit*
Please excuse my code...it's messy and I need to clean it up. Here's the copy of my ActionScript that I use to detect the URL change. It's also messy and needs cleaning up, but it works. The frame that it redirects to is the frame right before it, so it's a constant loop. import flash.external.ExternalInterface;
var myUrl:String = String(ExternalInterface.call("getHash", null));
if ( myUrl == "#home" and _root.link != 1 and _root.flag == 1 ) {
_root["item"+_root.link].gotoAndPlay("s2");
_root.item1.gotoAndPlay("s1");
_root.link = 1;
_root.linkhead = 1;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleHome");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#customsoftware" and _root.link != 2 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item2.gotoAndPlay("s1");
_root.link = 2;
_root.linkhead = 2;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleCustom");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#companyprofile" and _root.link != 3 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item3.gotoAndPlay("s1");
_root.link = 3;
_root.linkhead = 3;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleProfile");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#backup" and _root.link != 4 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item4.gotoAndPlay("s1");
_root.link = 4;
_root.linkhead = 4;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleBackup");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#serverhosting" and _root.link != 5 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item5.gotoAndPlay("s1");
_root.link = 5;
_root.linkhead = 5;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleServer");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#hardware" and _root.link != 6 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item6.gotoAndPlay("s1");
_root.link = 6;
_root.linkhead = 6;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleHardware");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#webdesign" and _root.link != 7 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item7.gotoAndPlay("s1");
_root.link = 7;
_root.linkhead = 7;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleDesign");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if ( myUrl == "#webhosting" and _root.link != 8 and _root.flag == 1 ){
_root["item"+_root.link].gotoAndPlay("s2");
_root.item8.gotoAndPlay("s1");
_root.link = 8;
_root.linkhead = 8;
_root.flag = 0;
_root.pgap.play();
ExternalInterface.call("titleHosting");
getURL("javascript:window.scroll(0,0);");
gotoAndPlay("pagedetect");
} else if (myUrl == "null") {
gotoAndPlay("nohash");
} else {
gotoAndPlay("pagedetect");
}
If anyone can give me some advice as to the issue I'm having in IE, I would GREATLY appreciate it! I've been working on this for a while, and I've hit another dead spot. Just FYI...there are a few links I haven't coded in yet. All I've got working is the left navigation. Thanks a whole bunch!
*Edit* Hey, I forgot to add the scripting on my buttons. import flash.external.ExternalInterface;
ExternalInterface.call("postHash", "home");
ExternalInterface.call("postTitle", "Creative Software Solutions - Home");