1
votes

I'm trying to play a movie clip of a circle expanding and fading away every time a user clicks. I make the movie clip, then I convert it to a movie clip again and create a motion tween making the circle get larger and fade away. But, when I call on the clip it just keeps playing over and over in the last place you click. If I set a stop at the last frame of the tween the next time you click it, it won't play.

fs15secTapBtn.addEventListener(MouseEvent.MOUSE_DOWN, fs15secdownHandler);

function fs15secdownHandler(event:MouseEvent):void
{
circletouch.x = mouseX;
circletouch.y = mouseY;
}

Thanks!

1
do you have more of the code to post? what starts/stops the animation? how is the animation run (tween code / timeline / other?)mfa
That's all of the code there is pertaining to the movie clip. There is no tween code, I made the movie clip so it has a 15 frame tween inside it. The code I posted above starts it in the location of the mouse just fine. However, it never stops playing the clip unles you put a stop(); at the end of the tween, but then it won't play again the next time you click. fs15secTapBtn is just a movie clip that takes up the whole frame of the stage if that matters.Cory

1 Answers

0
votes

You need to start/stop the movieclip every time you click. Right now, when you click the first time the clip would be put on stage and playing. Then when you click again, all you're doing is modifying the x and y positions of the clip, which moves the clip to the mouse coords...but the clip itself would still be continuing to be in whatever state it is in during the click (playing on it's own at whatever frame).

Within your click handler add in a circletouch.gotoAndPlay(1); to restart the playing at frame 1. Also, you may want to re-add that stop(); back in so that it'll only play once.