/*Load in external swf */
var loadSwf:Loader = new Loader();
var requestSwf:URLRequest = new URLRequest("photo_gallery.swf");
loadSwf.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
loadSwf.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
loadSwf.load(requestSwf);
/* Add swf to stage */
function onCompleteHandler (loadEvent:Event) {
stage.addChild(loadEvent.currentTarget.content);
}
/* Progress tracking*/
function onProgressHandler(mProgress:ProgressEvent) {
var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
trace (percent);
}
|