# Please help with preloader and .as file

**URL:** https://forum.kirupa.com/t/please-help-with-preloader-and-as-file/292229
**Category:** flash
**Created:** [July 12, 2009, 12:05am UTC](https://forum.kirupa.com/t/please-help-with-preloader-and-as-file/292229 "2009-07-12T00:05:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ecptavares](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@ecptavares](https://forum.kirupa.com/u/ecptavares)
#### Post date: [July 12, 2009, 12:05am UTC](https://forum.kirupa.com/t/please-help-with-preloader-and-as-file/292229/1 "2009-07-12T00:05:09Z")

</div>

Hi!  
I am trying to build my first web site using pure(or almost pure) .AS file.

Inside my main fla file I have a MC with an animation that is an introduction.

I am doing this at my as file:

```auto

var animacao : intro = new intro();

```

and I have a function to load up the animation when a user first enter the site with this code

```auto

        private function loadAnimation():void
        {
            animacao.x = 190;
            animacao.y = 450;
            addChild(animacao);
            addEventListener(Event.ENTER_FRAME, onEnterFrame);
        }

        private function onEnterFrame(e:Event):void
        {
            if (animacao.fim)
            {
                animacao.fim = false;
                removeEventListener(Event.ENTER_FRAME, onEnterFrame);
                removeChild(animacao);
                loadBackground();
            }
        }
        

```

this onEnterFrame event is to know when my animatin reachs the end.

Everything is working correctly except that I need to put a preloader before a load this animation but how do I do this since I am using it from my fla file?

thank you
