# Animated Preloader

**URL:** <https://forum.kirupa.com/t/animated-preloader/298927>\
**Category:** Uncategorized\
**Created:** [October 27, 2009, 10:48am UTC](https://forum.kirupa.com/t/animated-preloader/298927 "2009-10-27T10:48:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daimz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/daimz/32/2383_2.png) [@Daimz](https://forum.kirupa.com/u/Daimz)\
**Post date:** [October 27, 2009, 10:48am UTC](https://forum.kirupa.com/t/animated-preloader/298927/1 "2009-10-27T10:48:20Z")

</div>

Hi I am wanting to make a very basic preloader that basicly shows the % loaded in type and then also gradually reveals the logo. Now I use to know how to do this in AS2 using masks but I have not been able to do it in AS3 and I haven’t found any tutorials on it either.

I have got this code:

```auto
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);
    }

}

```

How can I tweak this do do what I am wanting? Oh and I am loading external swf’s in to a loader.
