|
-
Looping a Movieclip with a button.
Ok, so basically I have a movieclip of a box fading in and out. I gave it an instance name of 'MC.' The first frame of that animation has a stop (); applied to it.
I then created a button with an instance name of 'startbutton.' Both were placed on the stage, and my AS looks like this:
startbutton.addEventListener(MouseEvent.MOUSE_OVER , startMovie);
startbutton.addEventListener(MouseEvent.MOUSE_OUT, stopMovie);
function startMovie(e:MouseEvent)
{
MC.play();
}
function stopMovie(e:MouseEvent)
{
MC.stop();
}
This works in that when I move my mouse over the button, the movieclip plays, but how do I get the movieclip to loop continuously while my mouse is over the button?
-
Move the stop() out of the looping clip and add it to the parent (probably the main timeline?) as MC.stop() so it doesn't get re-executed every time you hit frame 1.
-
 Originally Posted by neznein9
Move the stop() out of the looping clip and add it to the parent (probably the main timeline?) as MC.stop() so it doesn't get re-executed every time you hit frame 1.
Thanks, that was simple enough.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|