Molybdenum
08-19-2009, 04:59 AM
I'd like to remove a MovieClip instance from the main timeline (and do a few other things) once that movie is over.
Scenario: I've got a frog catching a fly with his tongue. Once the frog-tongue movie clip is over, I want to remove both the tongue, and the fly from the timeline. Both the tongue and the fly are MovieClip objects. The tongue animation starts based on a TimerEvent. I'd like to say something like: when the tongue MovieClip ends, call removeChild() on tongue and fly.
Any ideas how to do that? I tried:
tongue.addEventListener(MotionEvent.MOTION_END,aft erMotion);
function afterMotion(m:MotionEvent)
{
trace("Motion over");
}
But the event never seems to fire...
Scenario: I've got a frog catching a fly with his tongue. Once the frog-tongue movie clip is over, I want to remove both the tongue, and the fly from the timeline. Both the tongue and the fly are MovieClip objects. The tongue animation starts based on a TimerEvent. I'd like to say something like: when the tongue MovieClip ends, call removeChild() on tongue and fly.
Any ideas how to do that? I tried:
tongue.addEventListener(MotionEvent.MOTION_END,aft erMotion);
function afterMotion(m:MotionEvent)
{
trace("Motion over");
}
But the event never seems to fire...