10/24/2010 2:09:38 AM
Title:
Movie Clips, cycling through.
Okay, so I have a Movie Clip on my stage, and within it are 6 keyframes in a row, but the first has a
stop();
on it, so that it just remains on the first frame. I want to be able to (during gameplay) click on that movie clip and on each click, have it cycle through to the next frame of that MovieClip, without it changing which frame I'm on in Scene 1.
How do I do this?
Rayan
Points: 700
Posts:0
10/24/2010 10:34:22 AM
you can attach a click handler on the movieclip and use mymovieclip.nextFrame() inside handller function to move to next frame on click
10/25/2010 12:08:27 AM
Asker here.
How do I do that? Sorry, I'm pretty new to Flash.
Rayan
Points: 700
Posts:0
10/25/2010 3:18:05 AM
Hi, try the following code. myMovieclip is your movieclip which you want to click and cycle frames.
myMovieclip.onRelease = function() {
if (myMovieclip._currentframe == myMovieclip._totalframes) {
myMovieclip.gotoAndStop(1);
} else {
myMovieclip.nextFrame();
}
};