I have a video that I am playing in the background of my movie.
function BackgroundManager(bkg){
if(bkg.substr(-4).toLowerCase() != '.flv'){
var loader:Loader = new Loader();
function loaded(evt:Event){
var bkg:DisplayObject = evt.target.content;
addChild(bkg);
}
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
loader.load(new URLRequest(bkg));
}
}
Pretty simple eh?
The problem is that the background takes a while to display. I’m not sure if Event.COMPLETE is being called after the whole thing is downloaded or just after it has buffered up to a point, but either way it seems to be too long. Is there a way to have it display faster?