Groups | Blog | Home
all groups > macromedia flash sitedesign > april 2005 >

macromedia flash sitedesign : Can a button load a swf at a specific frame?


anyb0dyme
4/14/2005 1:45:37 PM
Greetings. I have several swf files that comprise chapters of my movie.
Towards the end of one swf the user has a choice between two different swfs.
One choice is a dead end. I have a "try again" button and I want the user to
go back to the end of the previous swf. How can this be done? Thanks in
advance.

PS This is the code so far, just without the specific frame:

on (release) {
loadMovie("scene_15-20.swf", "_root");
}
PhaetRush
4/16/2005 12:00:00 AM
Im sure there might be a better way to do this, but here's my hack'n'slash
style of getting what you want done.


On the 1st frame use this code along side your preloader (or stand alone)

if (_root.replay == true){
gotoAndPlay("lastframe");
_root.replay = false;
}
else if(_root.replay != true){
gotoAndPlay("openingframe");
}


assuming you have a preloader, you would place that where the script would run
at "100% loaded"


now, with your script, you add a simple snip -

on(release){
loadMovie("scene_15-20.swf",_root");
_root.replay = true;
}

Now, your first frame will automatically check if the viewer is runnign
through for the first time, or a replay to the frame you desire.

Hope that helps,


Rush
AddThis Social Bookmark Button