PDA

View Full Version : Flash wont load the swfs. Interesting....


IrishGuyCE
03-24-2006, 08:19 PM
Ok everyone here is the intrigue for the day. I could really use some expert advice. But let me explain the situation.

I have a website I designed. Its one flash file (swf). And loads part of the menu into a scrollpane. Conviently named (Content). So each time I click on a button it loads the next swf file into the that window with a script like this.

on(release) {
Content.contentPath = "Newsletter.swf";
gotoAndStop(3);
}

It works great. The issue is after creating this, I knew the back button wouldn't work. So I began using what I know and the tutorials to enable it by sending variable to a hidden html frame which sends it to flash. That too works great. The issue is when the variable then gets to flash, which I know it does cause I have the dynamic text reading out the changes, I try to tell flash when that variable changes to a specific number to load the corresponding swf file into the "Content" scrollpane. It seems like nothing I do and no code I have written allows that to happen. I use the same actionscript command as I use on the buttons that work, only its does work with the variable. What am I doing wrong.

The over all point of what I am trying to accomplish is to get the actual back button to work. So everytime I load a new swf (section of the site) into "content" it builds history and will allow the user to go back. If you know of a better way I would love to hear. :)

Here is an example of the script being written so you can get an idea of what I am trying to accomplish.
By the way "textnum" is what I typed into the VAR section of the dynamic text

if (_root.textnum == 3) {
Content.contentPath = "Newsletter.swf";
}

Am I wrong to assume the this code means when the variable 3 is loaded into "textnum" the scrollpane "content" should be loaded with newsletter.swf. If anyone knows what I am doing wrong please let me know. It appears to me the the actionscript that is ordering the loading of the movie is not working...though i don't get any errors.. it just doesnt work. Everything else works even the back button lights up to go back. BUT it doesnt change the swfs, only the bottom hidden frame and the text field called textnum. So.... if you want to chat in person vs forum chat my AIM name is IrishGuyCDE and my email is [email protected] Thanks and looking foward to hearing you all's thoughts.

GFlashMan
03-25-2006, 08:51 PM
Did you try using a different frame for each content?
//button one
on(release) {
Content.contentPath = "Newsletter.swf";
gotoAndStop(3);
}
//button two
on(release) {
Content.contentPath = "Newsletter2.swf";
gotoAndStop(4);
}
//and so on

//your back button would be:

on (release) {
prevFrame();

}

IrishGuyCE
03-28-2006, 04:55 PM
Yes I actually tried that... however the drop down menu utilizes certain frames so moving between frames wont work cause the menu works that way. Plus this is to enable the actual browsers back button.... Any other thoughts though... I am still stumped.