# Preloading issue flash CS4 with AS3

**URL:** <https://forum.kirupa.com/t/preloading-issue-flash-cs4-with-as3/305168>\
**Category:** flash\
**Created:** [February 20, 2010, 5:49am UTC](https://forum.kirupa.com/t/preloading-issue-flash-cs4-with-as3/305168 "2010-02-20T05:49:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitbalde](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@amitbalde](https://forum.kirupa.com/u/amitbalde)\
**Post date:** [February 20, 2010, 5:49am UTC](https://forum.kirupa.com/t/preloading-issue-flash-cs4-with-as3/305168/1 "2010-02-20T05:49:47Z")

</div>

hello Guys,

i am a flash developer and recently start working with cs4 with as3  
i am really new with the AS3 but a master in as2.

i am having problem with preloading action script. I’m using AS3.  
the script runs perfectly in flash environment (simulate download progress in software). but when i integrate my flash object in html page and upload it, its not working in browser. movie get stop and nothing happen further  
below is my code. please anyone help me?

addEventListener(Event.ENTER\_FRAME, loading);  
function loading(e:Event)  
{  
var bytestotal = stage.loaderInfo.bytesTotal;  
var bytesloaded = stage.loaderInfo.bytesLoaded;  
var percent = Math.round(bytesloaded \* 100/bytestotal);  
this.preloaderMC.loader.loader.gotoAndPlay(percent);  
this.preloaderMC.loader.loaderR.gotoAndPlay(percent);

```
     if (bytesloaded == bytestotal)
  {      
  gotoAndPlay(2);
  removeEventListener(Event.ENTER_FRAME, loading);
 
  }
  }
  stop();
```
