I'm trying to make a credits page with a video playing in the background and when the menu button on screen is clicked you will be taken to the main menu and the video will stop. When debugging my app though, the following code cause it to cycle through all 5 scenes at lightspeed, not sure what causes this. I'll show you what code it likes and what code it doesn't.
Bugged code:
stop();
import fl.video.*;
import flash.events.VideoEvent;
Playback.source = "TONIGHT'S THE NIGHT.flv";
function FLVDone(event:VideoEvent):void{
event.target.stop();
}
Playback.addEventListener(VideoEvent.COMPLETE, FLVDone);
function FLVDone(event:VideoEvent):void{
event.target.stop();
}
//Menu Button
btnMenu.addEventListener(MouseEvent.MOUSE_UP, Menu5Clicked);
function Menu5Clicked (e:MouseEvent){
gotoAndStop(1)
FLVDone()
}
Working Code with no stop feature:
stop();
import fl.video.*;
import flash.events.VideoEvent;
Playback.source = "TONIGHT'S THE NIGHT.flv";
//Menu Button
btnMenu.addEventListener(MouseEvent.MOUSE_UP, Menu5Clicked);
function Menu5Clicked (e:MouseEvent){
gotoAndStop(1)
}
Here's the output
WARNING: Duplicate label, Scene=Scene 1, Layer=BG, Frame=2, Label=Credits WARNING: Duplicate label, Scene=Scene 1, Layer=BG, Frame=3, Label=Credits WARNING: Duplicate label, Scene=Scene 1, Layer=BG, Frame=4, Label=Credits WARNING: Duplicate label, Scene=Scene 1, Layer=BG, Frame=5, Label=Credits
Fonts should be embedded for any text that may be edited at runtime, other than text with the "Use Device Fonts" setting. Use the Text > Font Embedding command to embed fonts.
this appears in both versions of the code when debugged