preloader problem
Hej..Jeg forsøger at lave en preloader. Kan dog ikke få det til at spille..
På min scene har jeg et movieclip kaldet holder_mc og et dynamisk tekstfelt kaldet loading_txt (kan evt. sende min fla fil)
as:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var holder:MovieClip=this.creatyEmptyMovieClip("holder_mc", this.getNextHighestDepth());
var image_mcl:MovieClipLoader=new MovieClipLoader();
var mclListener:Object= new Object();
mclListener.onLoadProgress=function(mc:MovieClip, LB:Number, TB:Number){
var pc:Number=Math.round(LB/TB*100);
loading_txt.text=pc+"%";
}
mclListener.onLoadInit =function(mc:MovieClip){
loading_txt.text="";
fadeTo(mc,0,100,1);
}
image_mcl.addListener(mcListener);
image_mcl.loadClip("billede.jpg",holder);
function fadeTo(mc:MovieClip, initA:Number, endA:Number, time:Number)
{var tweenA:Tween=new Tween(mc,"_alpha", Regular.easeOut,initA, endA, time, true);
}