John Hill
August 7th, 2003, 02:30 AM
i'm building a pretty large website totally using flash. The button animations and action scripts are all pretty basic though. when i test the site out on my harddrive, with only one scene (the main index page) that then imports other flash swf's for the other sections of the website, it all works fine. there are three layers in this scene, navigation (where the buttons are) actions (where the scripts are) and background. the background consists of a looping animation (18 frames long) that is suppossed to play in the background forever. it works okay, with the other sections (external swf's) loading on top of it fine, and then disappearing when I use the back button.
however, when i tack on another scene with a basic preloader (percentage bar) before that main index scene and then test it, it seems fine, but when you click on a button and it imports the external swf, it only stays up for a few seconds. it's like because the main index scene has the looping animation, everytime it reaches back to frame 1 it resets the buttons.
the problem makes some sense to me, but what i don't understand is why it doesn't seem to care about the loop when it's just one scene, but when i add the preloader scene ahead of it, it starts acting screwy.
the preloader is two frames long and is really nothing more than a percentage bar loading.
the code for the preloader (frame 1) is this:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*438;
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
frame 2 is:
this.gotoAndPlay(1);
an example of the basic button's actionscript is:
on (release) {
_root.contents.loadMovie("navcharacter.swf");
}
if anyone has any suggestions, i would great appreciate them, especially since i also plan to have preloaders before the individual sections (external swf's) that will be loading on top of this main index swf.
thanks alot.
john hill
however, when i tack on another scene with a basic preloader (percentage bar) before that main index scene and then test it, it seems fine, but when you click on a button and it imports the external swf, it only stays up for a few seconds. it's like because the main index scene has the looping animation, everytime it reaches back to frame 1 it resets the buttons.
the problem makes some sense to me, but what i don't understand is why it doesn't seem to care about the loop when it's just one scene, but when i add the preloader scene ahead of it, it starts acting screwy.
the preloader is two frames long and is really nothing more than a percentage bar loading.
the code for the preloader (frame 1) is this:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*438;
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
frame 2 is:
this.gotoAndPlay(1);
an example of the basic button's actionscript is:
on (release) {
_root.contents.loadMovie("navcharacter.swf");
}
if anyone has any suggestions, i would great appreciate them, especially since i also plan to have preloaders before the individual sections (external swf's) that will be loading on top of this main index swf.
thanks alot.
john hill