PDA

View Full Version : Animation



dilpreet
April 27th, 2009, 02:53 AM
hey

i have a over and out animation but i only want to play the out animation when the over animation has completely finished and the same with out animation.

i have this code



text_mc.buttonMode = true;
text_mc.addEventListener(MouseEvent.ROLL_OVER, textOver);

function textOver(e:MouseEvent):void
{
e.currentTarget.gotoAndPlay("over");
text_mc.addEventListener(MouseEvent.ROLL_OUT, textOut);
text_mc.removeEventListener(MouseEvent.ROLL_OVER, textOver);
}

function textOut(e:MouseEvent):void
{
e.currentTarget.gotoAndPlay("out");
text_mc.addEventListener(MouseEvent.ROLL_OVER, textOver);
text_mc.removeEventListener(MouseEvent.ROLL_OUT, textOut);
}

wanzai
April 27th, 2009, 06:14 AM
was there a question in your post?

redelite
April 27th, 2009, 09:39 AM
Try having your animator class (or method) dispatch an event that says "finished", and not allow the other animation to fire until that event has been dispatched.