Hi, i am working on a preloader, that could be used as drag a drop component… the basic idea is to make a preloader that could be place in any movie and it shows it loading progress…
here is the code
this.parent.loaderInfo.addEventListener(Event.COMPLETE, downloadComplete);
this.parent.loaderInfo.addEventListener(ProgressEvent.PROGRESS, downloadProgress);
function downloadComplete(eve:Event):void
{
this.visible = false;
trace (this.parent.name);
}
function downloadProgress(eve:ProgressEvent):void
{
var loaded:Number = this.parent.loaderInfo.bytesLoaded;
var total:Number = this.parent.loaderInfo.bytesTotal;
var percent:Number = Math.round(loaded/total *100);
trace (percent);
}
the problem i am facing is the ProgressEvent is fired when the movie is completely downloaded… how can i make it work