Greensock!
I've implemented the beginning pieces of loaderMax into a template I purchased, that I asked about a few days ago and I think it's good to go.
Just a few thing such as whether or not I have it setup correctly. Each swf that loads, has it's own XML file. Do I have to insert code into each swf or does LoaderMax recognize that info while it's loading it in the queue? Not sure I fully understood the documentation explanation. Sorry about that. Trying to wrap my head around it. So taking the sample code from the LoaderMax page this is how I have it setup:
import com.greensock.*;
import com.greensock.loading.*;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.display.*;
//create a LoaderMax named "mainQueue" and set up onProgress, onComplete and onError listeners
var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});
//append several loaders
queue.append( new SWFLoader("content.swf", {name:"contentClip", estimatedBytes:126000, container:this, visible:false, autoPlay:false}) );
queue.append( new SWFLoader("team.swf", {name:"teamClip", estimatedBytes:129000, container:this, visible:false, autoPlay:false}) );
queue.append( new SWFLoader("news.swf", {name:"newsClip", estimatedBytes:140000, container:this, visible:false, autoPlay:false}) );
queue.append( new SWFLoader("contact.swf", {name:"contactClip", estimatedBytes:70000, container:this, visible:false, autoPlay:false}) );
//start loading
queue.load();
//pause loading
queue.pause();
//resume loading
queue.resume();
function progressHandler(event:LoaderEvent):void {
trace("progress: " + event.target.progress);
}
function completeHandler(event:LoaderEvent):void {
trace(event.target + " is complete!");
}
function errorHandler(event:LoaderEvent):void {
trace("error occured with " + event.target + ": " + event.text);
}
I don't want the swf's to show, just be cached so I used the visible property. That right? And to clarify my earlier question about the XML data, should I just put those in the queue here as well? At this point I'm not too concerned about showing a progress bar...maybe that will come later once I get more comfortable with these basic steps. Thanks again for all the help. You rule!
bD