header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Tid
Points:0
Posts:0

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?



1
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

2
Tid
Points: 0
Posts:0
10/25/2010 12:08:27 AM



Asker here.
How do I do that? Sorry, I'm pretty new to Flash.

3
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();
	}
};


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 3+1 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions