# as2: preloader that plays animation

**URL:** <https://forum.kirupa.com/t/as2-preloader-that-plays-animation/244773>\
**Category:** flash\
**Created:** [November 21, 2007, 4:59pm UTC](https://forum.kirupa.com/t/as2-preloader-that-plays-animation/244773 "2007-11-21T16:59:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![always\_one\_up](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@always\_one\_up](https://forum.kirupa.com/u/always_one_up)\
**Post date:** [November 21, 2007, 4:59pm UTC](https://forum.kirupa.com/t/as2-preloader-that-plays-animation/244773/1 "2007-11-21T16:59:22Z")

</div>

I have a problem with a preloader (yes, I’ve tried to use “search”).

it’s in separate swf and it loads swf with my website using loadMovie. what I want is the following: in the 1st frame it downloads all the website swf data, after it’s completed it plays frame 10 up to frame 60 and when it reaches it it starts the website. maybe someone could fix my AS code as I have some serious problems with it…

```auto

var presentation:MovieClip = this.createEmptyMovieCli p("presentation", this.getNextHighestDepth ()); 
presentation.loadMovie(" test.swf"); 
this.onEnterFrame = function():Void { 
var loadedData:Number = this.presentation.getByt esLoaded(); 
var allData:Number = this.presentation.getByt esTotal(); 
var percent:Number = Math.round(loadedData/al lData*100); 
tlo_Glow._alpha = (20 + percent); 
rectMask_mc._y = 680 - (percent * 0.85); 
if (loadedData >= allData) { 
gotoAndPlay(10); 
delete this.onEnterFrame; 
this.presentation._visible = false; 
} 
}; 

```

and in the last frame:

```auto

this.presentation._visible = true; 
stop();

```

any help would be really appreciated!
