Groups | Blog | Home
all groups > flash actionscript > july 2005 >

flash actionscript : Frame label in conditional logic



-anne-marie-
7/25/2005 8:17:13 PM
I am creating a feature where I load a movie at level5, and let the user click
a button labelled "Next picture" to see pictures in the newlyu loaded movie.
When they click the button after having seen the last picture, I want the movie
to unlad, so that they go back to the root movie.

Could somebody please see through the code snippet and tell me what I am doing
wrong?

nesteBilde_btn.onRelease = function () {
if (nextFrame="lastFrame_label") {
unloadMovieNum (5);
}
nextFrame;
}
Have A Banana
7/25/2005 8:30:54 PM
Hello,

First: You should put the nextFrame() method before your if statement, making
sure to put your movieclip name before the call. Next: Use _currentFrame to
compare (==) to the label for your last frame (assuming it's named
"lastFrame_label", you ought to be good here). So, here is how I would change
it:

nesteBilde_btn.onRelease = function (){
// you could also set the _currentFrame, play();, etc.
my_mc.nextFrame();
if( my_mc._currentFrame == "lastFrame_label"){
unloadMovieNum(5);
}
}
Hope that helps. Good luck!
AddThis Social Bookmark Button