# \[Flash8\]Is there a way to make a preloader with onEnterFrame and...?

**URL:** https://forum.kirupa.com/t/flash8-is-there-a-way-to-make-a-preloader-with-onenterframe-and/171161
**Category:** flash
**Created:** [December 2, 2005, 10:10am UTC](https://forum.kirupa.com/t/flash8-is-there-a-way-to-make-a-preloader-with-onenterframe-and/171161 "2005-12-02T10:10:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![victord\_21](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/victord_21/32/1960_2.png) [@victord\_21](https://forum.kirupa.com/u/victord_21)
#### Post date: [December 2, 2005, 10:10am UTC](https://forum.kirupa.com/t/flash8-is-there-a-way-to-make-a-preloader-with-onenterframe-and/171161/1 "2005-12-02T10:10:28Z")

</div>

Is there a way to make a preloader base on onEnterFrame function and then delete it after the content has finished loading? I’m asking this because I used this method for some thumbnail preloader movie but the thing is that when I end up with 30 generated thumbnails they eat up processor power because each thumnail’s onEnterFrame function is running endlessly…

The code I used is this one and it’s placed inside the tumbnail clip where the preloader components are:

```auto

thumb_loader.thumbLbar._xscale = 0;
loader_text._visible=false;
thumb_loader._visible=false;
this.onEnterFrame = function() {
				filesize = thumbHolder.getBytesTotal();
				loaded = thumbHolder.getBytesLoaded();
				thumb_loader._visible = true;
				loader_text._visible=true;
				if (loaded != filesize) {
					loader_text.loadT.text=Math.round(100*loaded/filesize);
					thumb_loader._visible=true;
					thumb_loader.thumbLbar._xscale = 100*loaded/filesize;
				} else {
					loader_text._visible=false;
					thumb_loader._visible=false;

				}
			} 

```

Now, when I want the onEnterFrame action to stop (whe teh content has finished loading) I add the following line inside the **[COLOR=DarkRed]else[/COLOR]** tag:

```auto

delete this.onEnterFrame;

```

but I know it’s not right because the preloader doesn’t show anymore…it displays for a split second at the begining of the download and then it disapears and at the end the content is displayed…

Does anyone know why that is?  
Appreciate any help I can get…
