Skip navigation
Currently Being Moderated

Animation for Exit

Jul 19, 2012 2:08 PM

I have ths code to attach a MovieClip to my main movie:


em_mc.addEventListener(MouseEvent.CLICK, fem3, false, 0, true);


function fem3(e:MouseEvent):void{

    var mc:section1=new section1();

    mc.y= 306;


    var myTween:Tween = new Tween(mc, "x", Elastic.easeInOut, -500, 481, 1, true);



The movieclip attaches with an animation.


When I close (or exit) the attachd MovieClip I do not get an animation for exit.


This is the code for exiting the attached Movieclip:


home_mcb.addEventListener(MouseEvent.CLICK, exitinteraction);


function exitinteraction(event:MouseEvent):void{




How Could I add a similar animation for exiting before removing the MovieClip from the main movie?

Currently the MovieClip just dissapears


Any help..thanks

  • Currently Being Moderated
    Jul 19, 2012 2:37 PM   in reply to edwinmerced

    What you should do is look into the Tween class so that you can understand what the parameters in it are indicating.  Then you should be able to create a tween that does the opposite.  If you need to have the object removed still, then you will need to add an event listener to the Tween for it MOTION_FINISH event... you can use that events handler function to do the this.parent.removeChild(this); that you have now.

    Mark as:
  • Currently Being Moderated
    Jul 19, 2012 7:18 PM   in reply to edwinmerced

    You're welcome

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points