Skip to main content
Known Participant
December 11, 2022
Answered

Mouse hover video

  • December 11, 2022
  • 1 reply
  • 2367 views

Hi, I would like to try to select a custom area or shape that will automatically appear and play a video based on that area whenever I mouse hover over it, and disappear and stop the video when I mouse over it.

 

How do I do this, please?

    This topic has been closed for replies.
    Correct answer kglad

    the component instance name is "video1"

     

    Sorry, I may have misunderstood your meaning, I'm not quite sure what other way there is to play the video... is there a better way?

     


    just leave it.  change the code to:

     

    video_mc.visible= false;
    video_mc.video1.stop();


    btn.addEventListener(MouseEvent.MOUSE_OVER,overF);
    video_mc.addEventListener(MouseEvent.MOUSE_OUT,outF);



    function overF(e:MouseEvent):void{

    video_mc.visible=true;

    video_mc.video1.play()

    }

    function outF(e:MouseEvent):void{

    video_mc.visible=false;

    video_mc.video1.stop();
    video_mc.video1.seek(0);

    }

     

     

     

     

    1 reply

    kglad
    Community Expert
    Community Expert
    December 11, 2022

    do you mean the video stops when you mouse out of the area?

    Noiz321Author
    Known Participant
    December 11, 2022

    yes, when I mouse out of the area the video will stop and disappear

     

    kglad
    Community Expert
    Community Expert
    December 11, 2022

    ok.

     

    and this is an html5 or as3 project?

     

    with your video playing in a video player component?