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
2010-07-06 16:44:37
Thanks for this!!! regarding this though, I would just add this code to the actions panel for "myVideo"?
Matt Nathanson
2010-07-06 16:47:54
Depending on how you're set up, you could put in the main timeline inside of an `actions` layer.
Serge
2010-07-06 16:55:46
thank you!! I will test it out tonight when i get home
Matt Nathanson
2010-07-06 16:58:52