# Preloader problem

**URL:** <https://forum.kirupa.com/t/preloader-problem/314742>\
**Category:** Uncategorized\
**Created:** [October 7, 2010, 11:20am UTC](https://forum.kirupa.com/t/preloader-problem/314742 "2010-10-07T11:20:06Z")\
**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:** [October 7, 2010, 11:20am UTC](https://forum.kirupa.com/t/preloader-problem/314742/1 "2010-10-07T11:20:06Z")

</div>

Hi all,

I want to create a preloader in preloader.as file.  
It will be in a seperate file.  
When the loading will become 100% then it will load next class file (loadgameScreen.as file)  
I use simple coding for that :

public function loading(e:ProgressEvent):void  
{  
var total:Number = \_ROOT\_MC.stage.loaderInfo.bytesTotal;  
var loaded:Number = \_ROOT\_MC.stage.loaderInfo.bytesLoaded;

this.\_loader.percentage\_txt.text = String((loaded / total) % 100);  
this.\_loader.bar\_mc.scaleX = (loaded / total) \* this.\_loader.bar\_mc.width;

if(total == loaded)  
{  
trace(“loading = 100”); removeEventListener(ProgressEvent.PROGRESS, loading);  
startGame();  
}  
}

but it is not showing the preloaderwhat would be a problem can somebosy tell me ???  
please help me.

-soha
