Skip to main content
Known Participant
Dec 11, 2022 2:15 PM UTC
Answered

Mouse hover video

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 is closed to new replies. Start a new post to keep the conversation going.
    kglad
    kgladCorrect answer
    Community Expert
    Dec 12, 2022 3:39 PM UTC

    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);

    }

     

     

     

     

    25 replies

    kglad
    Community Expert
    Community Expert
    Dec 11, 2022 2:33 PM UTC

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

    Translate
    Noiz321Author
    Known Participant
    Dec 11, 2022 2:39 PM UTC

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

     

    Translate
    kglad
    Community Expert
    Community Expert
    Dec 11, 2022 2:58 PM UTC

    ok.

     

    and this is an html5 or as3 project?

     

    with your video playing in a video player component?

    Translate