Question
play and stop movieclip with button
i want to play an mc from frame 1 to frame 20 - so far so good - here ist the script
rot_anim.stop();
function rot_animation (evt:MouseEvent) {
rot_anim.gotoAndPlay(1);
rot_anim.addEventListener(Event.ENTER_FRAME,fStop);
}
function fStop(evt:Event)
{
if (rot_anim.currentFrame>19) {
rot_anim.stop();
rot_anim.removeEventListener(Event.ENTER_FRAME,fStop);
}
}
rot_anim.addEventListener(MouseEvent.CLICK, rot_animation);now i would like to start to play the mc with a click on a button - but that does not work and i do not know what i am doing wrong. can anybody help me?
here is the script for the button calling the function
button1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
rot_animation.play();
}
