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

music not stopping on video when back button is pressed

Community Beginner ,
Apr 02, 2019 Apr 02, 2019

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
771
Translate
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

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

Translate
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

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?

Translate
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

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

}

Translate
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

Excellent.

Loving the work

Translate
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
LATEST

great!

Translate
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