I have an animated intro and menu as a swf. When you click on a chapter it loads a external swf with a flv in it. when the movie ends I want the video to unload and the menu section of the intro swf to load.
What is the best way to accomplish this?
Here is the code for the intro swf ( i only have the introduction bttn active for testing):
stop();
var PhysTestRequest:URLRequest = new URLRequest("trainIntro.swf");
var PhysTestLoader:Loader = new Loader();
intro_btn.addEventListener(MouseEvent.MOUSE_DOWN, newvid);
function newvid(event:MouseEvent):void {
trace("you clicked me");
PhysTestLoader.load(PhysTestRequest);
addChild(PhysTestLoader);
}
intro_btn.buttonMode=true;
This is the code for the swf file containg the flv:
import fl.video.*;
import fl.controls.ProgressBarMode;
// Set Variables
var flvControl = display;
var flvSource = “Introduction.flv”;
// Create event handler functions to control the progressbar
function progressHandler(event:VideoProgressEvent):void {
var bl = Math.round(event.bytesLoaded/1000);
var bt = Math.round(event.bytesTotal/1000);
// Update progress...
pb.setProgress(bl,bt);
}
function readyHandler(event:VideoEvent):void {
// Remove progressbar when we start playing…
removeChild(pb);
}
Any help would be greatly appreciated.
Scott
// Set progress bar state
pb.mode = ProgressBarMode.MANUAL;
pb.indeterminate = false;
// Add listeners and load the video
flvControl.addEventListener(VideoProgressEvent.PROGRESS, progressHandler);
flvControl.addEventListener(VideoEvent.READY, readyHandler);
flvControl.source = flvSource;
buttonMode = false;