# AS3 Pre-Loader... yawn!

**URL:** <https://forum.kirupa.com/t/as3-pre-loader-yawn/272756>\
**Category:** Uncategorized\
**Created:** [October 8, 2008, 9:00am UTC](https://forum.kirupa.com/t/as3-pre-loader-yawn/272756 "2008-10-08T09:00:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garfty](https://avatars.discourse-cdn.com/v4/letter/g/8baadc/32.png) [@Garfty](https://forum.kirupa.com/u/Garfty)\
**Post date:** [October 8, 2008, 9:00am UTC](https://forum.kirupa.com/t/as3-pre-loader-yawn/272756/1 "2008-10-08T09:00:25Z")

</div>

Just a quickie, after watching the [gotoandlearn.com](http://gotoandlearn.com) tutorial about AS3 pre loading, I was amazed to see that this was the best way and i’ve been using this from the start, so i was quite chuffed by that. however, there is something puzzling me at the moment.

After the loader is finished and items are added to the stage, how would you hold the loader to do a transition to end the loader or make it aesthetically nicer.

below is the code, thank you!

```auto
var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("content.swf"));

function loop(e:ProgressEvent):void
{
	var perc:Number = e.bytesLoaded / e.bytesTotal;
	percent.text = Math.ceil(perc*100).toString();
}

function done(e:Event):void
{
	removeChildAt(0);
	percent = null;
	addChild(l);
}

```
