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

music not stopping on video when back button is pressed

Community Beginner ,
Apr 02, 2019 Apr 02, 2019

Copy link to clipboard

Copied

Hi I have a video on a scene

The video is on its own scene. The video is of file format .mp4 file format. When I import the video to flash a dialogue box loads Select Video

Where is your video file?

On your computer.

I select radio button load external video with playback components.

The video has sound on it. On this scene I have added a back button that takes the user to a navigation scene. When the user clicks on the back button the music continues to play. How can I get the video to stop playing when I press the back button.

I am using actions script 3 code. This is the code for the button.

stop();

import flash.events.MouseEvent;

 

bkbtn.addEventListener(MouseEvent.CLICK, backbtnEvent);

function backbtnEvent(evt:MouseEvent):void

{

            gotoAndPlay(1,"Navigation");

}

Capture.png

TOPICS
ActionScript

Views

654

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
Community Expert ,
Apr 02, 2019 Apr 02, 2019

Copy link to clipboard

Copied

stop your flvplayback when navigating away from the frame that contains your video.

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
Community Beginner ,
Apr 03, 2019 Apr 03, 2019

Copy link to clipboard

Copied

Hi thank this works. If you press the stop or pause button on the flvplayback then press the back button the music stops playing in the background. Just wondering, is there code for flvplayback to stop the video it if the uuser has forgotten to press the stop button on the video player?

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
Community Expert ,
Apr 03, 2019 Apr 03, 2019

Copy link to clipboard

Copied

yes, that's why i meant in message 1.

assign your flvplayback instance a name (eg, flv_pb) and apply stop() to it:

function backbtnEvent(evt:MouseEvent):void

{

flv_pb.stop();

            gotoAndPlay(1,"Navigation");

}

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
Community Beginner ,
Apr 05, 2019 Apr 05, 2019

Copy link to clipboard

Copied

Excellent.

Loving the work

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
Community Expert ,
Apr 05, 2019 Apr 05, 2019

Copy link to clipboard

Copied

LATEST

great!

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