• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Mouse hover video

New Here ,
Dec 11, 2022 Dec 11, 2022

Copy link to clipboard

Copied

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?

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 12, 2022 Dec 12, 2022

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

}

 

 

 

 

Votes

Translate

Translate
Community Expert ,
Dec 12, 2022 Dec 12, 2022

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines