# Is there a way

**URL:** <https://forum.kirupa.com/t/is-there-a-way/320122>\
**Category:** Uncategorized\
**Created:** [March 14, 2011, 10:17pm UTC](https://forum.kirupa.com/t/is-there-a-way/320122 "2011-03-14T22:17:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nour1234](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@nour1234](https://forum.kirupa.com/u/nour1234)\
**Post date:** [March 14, 2011, 10:17pm UTC](https://forum.kirupa.com/t/is-there-a-way/320122/1 "2011-03-14T22:17:06Z")

</div>

Okay, a bit confusing, but I have created a Flash site using action script 3. The whole site without the “Projects” folder is 800KB. With the projects folder it’s 2.2MB.

I already created a loader that waits until the entire site is loaded before playing, but for slower connections it takes too long to load the entire site. I was just wondering if I can set my loader to load only frames 1-x, and load the rest of the frames on clicking the Projects button.

The link is Click here

The code I used for the loader is

stop();  
this.addEventListener(Event.ENTER\_FRAME, loading);

function loading(e:Event):void{

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

bar\_mc.scaleX = loaded/total;  
loader\_txt.text = Math.floor((loaded/total)\*100)+ “%”;

if (total == loaded){  
play();  
this.removeEventListener(Event.ENTER\_FRAME, loading);  
}

}

Any help appreciated.
