Not having much luck. My project preloader swf looks like so: (shortened onComplete)
public function Preloader() {
// set visibility
//movMain.movBook.visible = false;
//we know the XML contains ImageLoader, SWFLoader, DataLoader, and MP3Loader data, so we need to activate those classes once in the swf so that the XMLLoader can recognize them.
LoaderMax.activate([imageLoader, SWFLoader, DataLoader, MP3Loader, VideoLoader]);
//create an XMLLoader
loader = new XMLLoader("settings.xml", {name:"xmlDoc", requireWithRoot:this.root, estimatedBytes:1400});
//Or you could put the XMLLoader into a LoaderMax. Create one first...
queue = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler, onInit:initHandler});
//append the XMLLoader and several other loaders
queue.append(loader);
//begin loading
queue.load();
var format:TextFormat = new TextFormat();
format.letterSpacing = 31;
function progressHandler(event:LoaderEvent):void {
//trace("progress: " + event.target.progress*100);
if(event.target.progress*100 < 99){
movCubes.txtProgress.text = String(Math.round(event.target.progress*100));
movCubes.txtProgress.setTextFormat(format);
}else if(event.target.progress*100 > 99){
movCubes.txtProgress.text = "99";
movCubes.txtProgress.setTextFormat(format);
}
}
// I shortened this, but it goes through and loads assets into the main swf.
function completeHandler(event:LoaderEvent):void {
var imageEnter:ContentDisplay = LoaderMax.getContent("img_enter");
var imageTopPanel:ContentDisplay = LoaderMax.getContent("img_top_panel");
var videoIntro:ContentDisplay = LoaderMax.getContent("video_intro");
etc etc
}
And my settings.xml file like so (again shortened)
<?xml version="1.0" encoding="iso-8859-1"?>
etc etc
at the moment, if I use:
addChild(videoIntro);
the video plays, but I want more control, like pause at the start, an oncomplete handler etc.
I couldn't get the init listener to work as you mentioned.
Can you help?
thanks,
Alex