Skip to main content
Participant
August 18, 2011
Question

Motion Tween

  • August 18, 2011
  • 1 reply
  • 352 views

Hi,

There is a movie clip "card" created dynamicaly through the code. I have a class, and i instanced it and add it to the stage. I need to move the movie clip on the button click, so I created a motion tween and export it to the code.

Then i wrote a function and asign it to the button through the event listener. But the movie clip doesn't move. The event fires, but nothing happens. Any ide how could this be solved?

Code examples:

1. Instace of a movie clip

var card:MovieClip = new Panic();

card.x=456.20;

card.y=77.30;

card.width=285;

card.height=355;

card.n = "IME";

stage.addChildAt(card,1);

2. Event handler:

rightArrow.addEventListener(MouseEvent.CLICK, onClick);

function onClick(evt:MouseEvent):void

{

__animFactory_panic.addTarget(card, 0);

}

3. Motion code is generated code, no need for posting.

Thank you in advance

This topic has been closed for replies.

1 reply

relaxatraja
Inspiring
August 18, 2011

Show your full code along with the motion tween.