Jump to content
Search Community

Problems with VideoEvent.COMPLETE

tkk11 test
Moderator Tag

Recommended Posts

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...