I\'m trying to get a movie clip to play in reverse when I mouse_out from it (it plays on mouse_over).
My actionscript is as follows:
mc.stop();
mc.ad
You can do it passing the movie clip object to find the correct object to reverse. This manner helps you to use with the child you want. You can get it with:
fMoveBack(this.getChildByName("my_clip"));
function fMoveBack(my_clip:MovieClip):void {
this.addEventListener(Event.ENTER_FRAME, playReverse(my_clip));
}
function playReverse(mc:MovieClip):Function {
return function playReverse(e:Event):void {
if (mc.currentFrame == 1) {
stopPlayReverse(mc);
} else {
mc.prevFrame();
}
};
}
function stopPlayReverse(mc:MovieClip):void {
if (this.hasEventListener(Event.ENTER_FRAME)) {
this.removeEventListener(Event.ENTER_FRAME, playReverse);
}
}