This blog talks about Life Experience Camping life Gaming life Passionate life Cooking recipe Spiritual Life Healthy Life Paintball Life of a Malaysian techie.

[FLASH] Move to next scene after movie clip finished

Sources: httphttpsboard.flashkit.com/board/showthread.php?t=511447
Reported Issues:

I have a very simple animation (object falls from off screen and lands with a bounce) and I simply want to go to the next frame when the animation has finished. Any straight forward way of doing this?

Found Solution:
Method 1
At the end of your animation just add the following.

Goes to a frame on the main timeline.
<!– Start Coding
_root.gotoAndPlay (“frame_label”);
End Coding –>

or

Goes directly to the very next frame of main timeline
<!– Start Coding
_root.gotoAndPlay.nextFrame();
End Coding –>

or

Plays a frame of an MC on the main timeline.
<!– Start Coding
_root.OtherMC.gotoAndPlay (“frame_label”);
End Coding –>

or

You can insert this into your main timeline to detect when a certain movieclip is done playing.
<!– Start Coding
if (_root.Animation._currentframe == “End Frame”) {
_root.gotoAndPlay(“frame_label”);
} else {
stop();
}
End Coding –>

Then add a frame label to the last frame of your animation movie clip.

The latter is easier to use, as you can just alter the script for many movie clips.

Method 2

<!– Start Coding
if (_root.Animation._currentframe == “End Frame”) {
_root.gotoAndPlay(“frame_label”);
} else {
stop();
}
End Coding –>

This does that.. For example..

Frame 1
<!– Start Coding
onEnterFrame = function () {
_root.AnimationMC.play();
}
End Coding –>

Frame 2
<!– Start Coding
if (_root.AnimationMC._currentframe == “end”) {
_root.gotoAndPlay(“frame_label”);
}
else {
play();
}
End Coding –>

Frame 3
<!– Start Coding
_root.gotoAndPlay.prevFrame();
End Coding –>

THis tells it, to run an animation, to check which frame the animation is on, if the animation is on the last frame that you labeled “end”. It will play the next frame.

‘;’ type=’text/javascript’>

Share this post! Let them know how awesome is this!
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on whatsapp
WhatsApp
Share on email
Email