Skip to main content
msa96947redlands
Participating Frequently
April 2, 2019
Question

music not stopping on video when back button is pressed

  • April 2, 2019
  • 1 reply
  • 816 views

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

}

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 2, 2019

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

msa96947redlands
Participating Frequently
April 3, 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?

kglad
Community Expert
Community Expert
April 3, 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");

}