Search code examples
actionscript-3flashanimationbuttonadobe

Adobe Flash. Mouseover animation endless loop


I'm having some problems while making a button for a site. I created a button and an animation, then imported that animation as an .swf to the button file. I used the following code(with btn being the button and mc the movie clip):

btn.addEventListener(MouseEvent.MOUSE_OVER,btnF);
function btnF(e:MouseEvent):void
{
    mc.play();
}

As you can imagine, when the mouse is over the button, the animation plays, but it doesn't stop... Any Solutions?

Details: Using Actionscript 3.0
And yes, i made the movie clip with a stop() code at the end... so I don't see why it loops.


Solution

  • It might be simpler to do it this way: create a button, on default state have the graphic for the button. On the over state use a movieclip with your animation. That should work without any code