Hello, there. I am trying to load an FLV with the greensock video loader, and once that is complete, load an SWF file. However, the VideoEvent.COMPLETE doesn't seem to be triggered once the FLV is done playing. Any ideas? Here's the code:
import com.greensock.loading.*;
import com.greensock.loading.display.*;
import com.greensock.*;
import fl.video.VideoEvent;
import com.greensock.events.LoaderEvent;
import flash.events.*;
import flash.display.*;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.utils.setInterval;
import script.menu.caurina.transitions.*;
//create a VideoLoader
var video:VideoLoader = new VideoLoader("gfx/ngvcFlashIntro.flv", {name:"myVideo",container:this,width:1024,height:768,scaleMode:"none",bgColor:0x000000,autoPlay:false,volume:0,requireWithRoot:this.root,estimatedBytes:75000});
//start loading
video.load();
var queue:LoaderMax = new LoaderMax({name:"mainQueue",onProgress:progressHandler,onComplete:completeHandler,onError:errorHandler});
//append the VideoLoader
queue.append( video );
//start loading the LoaderMax queue
queue.load();
function progressHandler(event:LoaderEvent):void
{
trace("progress: " + event.target.progress);
}
function completeHandler(event:LoaderEvent):void
{
//play the video
video.addEventListener(VideoEvent.COMPLETE, loadStage);
video.playVideo();
//tween the volume up to 1 over the course of 2 seconds.
TweenLite.to(video, 2, {volume:1});
}
function loadStage()
{
trace("loadStage called");
var tmpMC:MovieClip = new MovieClip();
var myURL = "landingPage.swf";
var myRequest:URLRequest = new URLRequest(myURL);
var loader:Loader = new Loader();
tmpMC.addChild(loader);
addChild(tmpMC);
loader.load(myRequest);
}
function errorHandler(event:LoaderEvent):void
{
trace("error occured with " + event.target + ": " + event.text);
}