# Should be simple movieclip preloader

**URL:** <https://forum.kirupa.com/t/should-be-simple-movieclip-preloader/158873>\
**Category:** Uncategorized\
**Created:** [August 12, 2005, 2:03pm UTC](https://forum.kirupa.com/t/should-be-simple-movieclip-preloader/158873 "2005-08-12T14:03:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [August 12, 2005, 2:03pm UTC](https://forum.kirupa.com/t/should-be-simple-movieclip-preloader/158873/1 "2005-08-12T14:03:02Z")

</div>

okay i’m new to mx2004 and i’m trying to get a movieclip that loads dynamic content (jpegs) to have a little preloader.

i think i’ve gotten this to work in the past but this code is doing nothing for me now. it seems like it should work…

I have a movieclip with the code on it and a movie clip (picPreload) on the layer above the clip (it contains a loadbar shape which masks an animated bar). both the movieclip that loads the jpegs and the preloader clip are in the same movieclip.

```auto
onClipEvent (enterFrame) {

picPreload.barberPole.setMask(picPreload.loadBar);

bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
if(bytes_loaded != bytes_total){
	picPreload._alpha=100;
picPreload.loadBar._width = getPercent*128;
}else{
if (bytes_loaded == bytes_total) {
	picPreload._alpha=0;
}
}
}

```

thanks for any help… can’t think clearly aafter 4 hours of sleep.
