Contact Yart for a relaxed conversation
Your Name * Message *
Your Email *  
Your Phone   
Our Phone:        03 8685 8718 (within Australia)
61 3 8685 8718 (outside Australia)
Contact Yart

Melbourne Content Management and Flash developers

 

for designers, agencies and your website

Resources / Flash / Loading
Loading symbols from external SWF + loading progress

This shows you how to load a Symbol from an external SWF, and tracing the progress as it is downloading the external file.

var loader = new Loader();
var ldrContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, handleProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleComplete);
loader.load(new URLRequest("externalMovie.swf"), ldrContext);

var object:MovieClip;

function handleProgress(e:ProgressEvent) {
trace(e.bytesLoaded + " : " + e.bytesTotal)
}

function handleComplete(e:Event) {
trace("Loaded");
//object = e.target.content as MovieClip;
var MyButton:Class = getDefinitionByName("MyButton") as Class;
addChild(new MyButton());
}
The latest at Yart
Search: