I am aiming for: when you put your mouse over the clip it plays and then stays on the last frame until the mouse is taken off, then the clip should return back to the first frame.
So far this code works that when you put your mouse over, the clip starts then stops on the last frame.
I also want it that even if you take the mouse off before the clip reaches the final frame it will still return to the first frame.
stop();
stage.addEventListener(MouseEvent.MOUSE_OVER, playMovie); function playMovie(event) { play(); }
stage.addEventListener(MouseEvent.MOUSE_OUT, stopMovie); function stopMovie(event) { stop(); }
stop();
Instead of using
stop()in yourstopMoviefunction, usegotoAndStop(1)to reset this to the first frame.You may want to use the
Event.MOUSE_LEAVEinstead of mouse out if you’re wanting this to happen when the mouse leaves the SWF entirely.