-
1. Re: Reusing animation with different endings?
kglad Jan 10, 2013 1:44 PM (in response to mentalcase129)sure, you can wait until your artsy animation completes before executing your gotoAndPlay. just have your buttons assign a variable (eg, nextframe_label) value. at the end of your artsy animation execute your gotoAndPlay(nextframe_label)
-
2. Re: Reusing animation with different endings?
moccamaximum Jan 11, 2013 6:18 AM (in response to mentalcase129)If your buttons are MovieClips (dynamic class), you can create own properties for them. (It doesn`t work if they are Graphics/Buttons)
In your case for example a property "clicked".
//at the beginning of your application all the Buttons are untouched
btn.clicked = false;
Then in your eventListener for the Click-Event, you
adjust the behavior of the button due to the state of this property.
btn.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(e:MouseEvent):void{
if(!e.currentTarget.clicked){
e.currentTarget.clicked = true;
//do the animation
}
else{
//skip the animation
}
}
That way, your application memorizes, if the user has already clicked the button, or not, and reacts accordingly
-
3. Re: Reusing animation with different endings?
mentalcase129 Jan 16, 2013 4:16 PM (in response to moccamaximum)Thanks...I'll play around with both of those. Here's another question though, cuz as I was playing with it more I had another idea. If I have a button programmed to play a movieclip on the timeline...can I attach a code to the movieclip so that when it's done playing it navigates to a different spot on the timeline?
-
4. Re: Reusing animation with different endings?
kglad Jan 16, 2013 6:04 PM (in response to mentalcase129)yes.
if you want to direct the movieclip parent timeline use:
MovieClip(parent).gotoAndPlay("some label");



