flashvideoadobeflash-cc

How to stop a video in a scene from playing after i move to another scene in flash?


I have 2 scenes, both with buttons linking both scenes together. But I encounter a problem when moving from scene 1 to scene 2. The video playing in scene 1 continue to play after i have when on to scene 2 to view another video. Is there a way to stop the previous video?

Here are my code in Adobe Flash CC action script.

Button 1 in scene 1

button_1.addEventListener(MouseEvent.CLICK, Scene_1ToScene2);

function Scene_1ToScene2(event: MouseEvent): void {
	gotoAndPlay(1, "Scene 2");
	stop();
}

Button 2 in scene 2

button_2.addEventListener(MouseEvent.CLICK, Scene_2ToScene1);

function Scene_2ToScene1(event: MouseEvent): void {
	gotoAndPlay(1, "Scene 1");
	stop();
}


Solution

  • Add in

    Video_001.stop();

    "Video_001" is the instance name of the video.