# Problem with simple preloader

**URL:** <https://forum.kirupa.com/t/problem-with-simple-preloader/148115>\
**Category:** Uncategorized\
**Created:** [May 17, 2005, 8:19am UTC](https://forum.kirupa.com/t/problem-with-simple-preloader/148115 "2005-05-17T08:19:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cosablaze](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@cosablaze](https://forum.kirupa.com/u/cosablaze)\
**Post date:** [May 17, 2005, 8:19am UTC](https://forum.kirupa.com/t/problem-with-simple-preloader/148115/1 "2005-05-17T08:19:39Z")

</div>

I’ve added the following piece of AS to frame 1:

```auto
this.onEnterFrame = function()
  {
	total = this.getBytesTotal();	
	loaded = this.getBytesLoaded();	
	percent = Math.round (loaded/total*100 );
	
	loadingText = percent;
	
	if (loaded >= total) {
		nextFrame();
		} 
  }
stop();

```

The preloader actually works fine, but the movie just plays till the end of the timeline and ignores the stop(); action I’ve put in a later frame. Without the preloader the movie works fine.

I hope someone can tell me what I’m doing wrong.
