views:

56

answers:

1

I'm wondering how I can make a Flash start playing a video on MouseOver, and stop playing on MouseOut.

+2  A: 

Assuming you've imported your video libraries and myVideo is the instance name of your video

myVideo.addEventListener(MouseEvent.MOUSE_OVER, playMovie);
myVideo.addEventListener(MouseEvent.MOUSE_OUT, stopMovie);

function playMovie(event:MouseEvent):void {
    myVideo.play();
}
function stopMovie(event:MouseEvent):void {
   myVideo.stop();
}
Serge
Thanks for this!!! regarding this though, I would just add this code to the actions panel for "myVideo"?
Matt Nathanson
Depending on how you're set up, you could put in the main timeline inside of an `actions` layer.
Serge
thank you!! I will test it out tonight when i get home
Matt Nathanson