# Preloader Component

**URL:** <https://forum.kirupa.com/t/preloader-component/291217>\
**Category:** Uncategorized\
**Created:** [June 26, 2009, 11:43am UTC](https://forum.kirupa.com/t/preloader-component/291217 "2009-06-26T11:43:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrMaxMad](https://avatars.discourse-cdn.com/v4/letter/d/d26b3c/32.png) [@DrMaxMad](https://forum.kirupa.com/u/DrMaxMad)\
**Post date:** [June 26, 2009, 11:43am UTC](https://forum.kirupa.com/t/preloader-component/291217/1 "2009-06-26T11:43:59Z")

</div>

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

```auto
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
