Hi, I’m using this code (below) from a site I found. Works fine.
I’d like to know what would be the arguement to removeChild. In other words, what would I put in the parentheses to remove the child the code created?
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;
function startLoad() {
var mLoader:Loader = new Loader();
var mRequest:URLRequest = new URLRequest('home.swf');
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
mLoader.load(mRequest);
}
function onCompleteHandler(loadEvent:Event) {
addChild(loadEvent.currentTarget.content);
}
function onProgressHandler(mProgress:ProgressEvent) {
var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
trace(percent);
}
startLoad();