Animated Preloader

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:

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.