code:
var theLoader:MovieClipLoader = new MovieClipLoader();
theLoader.loadClip(Url, MovieClip);
var loaderListener:Object = new Object();
theLoader.addListener(loaderListener);
MovieClip.loader_txt.text = "0%";
loaderListener.onLoadProgress = function(_mc:MovieClip, loaded:Number, total:Number) {
MovieClip.loader_txt.text = Math.round((loaded/total) * 100) + "%";
}
loaderListener.onLoadComplete = function(_mc:MovieClip) {
MovieClip.loader_txt.text = "";
}
note:
variables are MovieClip and Url
No comments:
Post a Comment