# A pre-loader question

**URL:** <https://forum.kirupa.com/t/a-pre-loader-question/315864>\
**Category:** flash\
**Created:** [November 5, 2010, 10:09pm UTC](https://forum.kirupa.com/t/a-pre-loader-question/315864 "2010-11-05T22:09:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rimacy](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rimacy](https://forum.kirupa.com/u/rimacy)\
**Post date:** [November 5, 2010, 10:09pm UTC](https://forum.kirupa.com/t/a-pre-loader-question/315864/1 "2010-11-05T22:09:49Z")

</div>

Here’s my code:

```auto
package
{
    import flash.display.MovieClip;
    import flash.events.*;
    import flash.text.TextField;
    
    public class Main extends MovieClip
    { 
        var bar:Bar=new Bar;
        var outLine:Outline=new Outline;
        var textField1:TextField=new TextField;
        var cat:Cat=new Cat;
        
        public function Main():void
        {
            bar.x=100;
            bar.y=100;
            outLine.x=300;
            outLine.y=100;
            textField1.x=300;
            textField1.y=100;
            addChild(bar);
            addChild(outLine);
            addChild(textField1);
            
            this.addEventListener(Event.ENTER_FRAME, preload);
        }
        public function preload(e:Event):void
        {
            var total:Number = this.stage.loaderInfo.bytesTotal;
            var loaded:Number = this.stage.loaderInfo.bytesLoaded;
            bar.scaleX = loaded/total;
            textField1.text = Math.floor((loaded/total)*100)+("%");
        if (total == loaded)
            {
                
                this.removeEventListener(Event.ENTER_FRAME, preload)
                playGame();
                
            }
            
        }
        public function playGame():void
        {
            trace("playGame");
            removeChild(bar);
            removeChild(outLine);
            removeChild(textField1);
            cat.x=200;
            cat.y=200;
            addChild(cat);
        }
    }
}

```

it all works the progress bar,text and outline are removed but no cat and no error messages.

What could this be???
