# Preloader for .as file

**URL:** <https://forum.kirupa.com/t/preloader-for-as-file/314487>\
**Category:** Uncategorized\
**Created:** [September 30, 2010, 5:42am UTC](https://forum.kirupa.com/t/preloader-for-as-file/314487 "2010-09-30T05:42:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![soha\_20088](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@soha\_20088](https://forum.kirupa.com/u/soha_20088)\
**Post date:** [September 30, 2010, 5:42am UTC](https://forum.kirupa.com/t/preloader-for-as-file/314487/1 "2010-09-30T05:42:54Z")

</div>

Hi all,

I want to write a code for .as file.

I wrote:

this.addEventListener(ProgressEvent.PROGRESS, loading);

function loading(event: ProgressEvent):void {

```
var total:int=this.stage.loaderInfo.bytesTotal;
var loaded:int=this.stage.loaderInfo.bytesLoaded;

```

var precent:int=(loaded/total)\*100);

if(precent==100){  
trace(“preloader finished”);  
}  
}

Though i changed the ProgressEvent to Event.ENTER\_FRAME it is not showing the text box output.

please help me.

-soha
