Hi, all you...
My problem is, that the myProgressBar in the stage to see for first, in all the her length than loading my swf on the stage, while after two seconds begin the loading in her scaleX, and all to go fine...
here my code that use, there is also the field with percentage....
package Max_SWF{
import com.greensock.loading.LoaderMax;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.*;
import flash.display.MovieClip;
import flash.events.*;
public class LoaderMaxSWF extends MovieClip {
public function LoaderMaxSWF() {
addEventListener(Event.ADDED_TO_STAGE,init);
}
private function init(evt:Event):void {
removeEventListener(Event.ADDED_TO_STAGE,init);
var queue:LoaderMax=new LoaderMax({onProgress:progressHandler});
queue.append(new SWFLoader("contatti.swf",{onComplete:completeHandler}));
queue.load();
}
public function completeHandler(event:LoaderEvent):void {
addChild(event.target.content);
}
public function progressHandler(event:LoaderEvent):void {
var kbps:int=(event.target.bytesLoaded/event.target.bytesTotal)*100;
mc_txt.text="LOADING: " + kbps.toString()+"%";
myProgressBar.scaleX=event.target.progress;
}
}
}
Thanks for my help
milcon