# Preloader Doesn't Work on Cached Files

**URL:** <https://forum.kirupa.com/t/preloader-doesnt-work-on-cached-files/107045>\
**Category:** Uncategorized\
**Created:** [April 11, 2004, 6:29pm UTC](https://forum.kirupa.com/t/preloader-doesnt-work-on-cached-files/107045 "2004-04-11T18:29:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mannequin](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@Mannequin](https://forum.kirupa.com/u/Mannequin)\
**Post date:** [April 11, 2004, 6:29pm UTC](https://forum.kirupa.com/t/preloader-doesnt-work-on-cached-files/107045/1 "2004-04-11T18:29:11Z")

</div>

Hi,

I’m loading a JPEG into an empty movie clip using the loadMovie() function. I’ve written a preloader, based on the one found [here](http://www.actionscripts.org/showMovie.php?id=42). It works well until the image is cached. Then it just does nothing.

Here is a link to the demonstration. (Recommended for broadband, the image it loads is quite big): [http://www.mannequin3d.com/preloadTest/movie1.html](http://www.mannequin3d.com/preloadTest/movie1.html)

You’ll notice the preloader looks great the first time around. When you refresh it stops functioning. Is there a way I can reset these values, or trick the preloader into working again?

Here is the [.fla file](http://www.mannequin3d.com/preloadTest/movie1kirupa.fla) (16kb)  
Here is the actionscript:

Frame 1:

```auto
_root.container.loadMovie("largeImage.jpg");
set(_root.container._alpha, 0);
stop();

```

Movie Clip:

```auto
onClipEvent(enterFrame) {
	_parent.total_bytes = getBytesTotal();
	_parent.loaded_bytes = getBytesLoaded();
	_parent.percent_done = int((_parent.loaded_bytes/_parent.total_bytes)*100);
	_root.bytestotal = Math.ceil(_parent.total_bytes / 1024) + "KB";
	_root.bytesloaded = Math.ceil(_parent.loaded_bytes / 1024) + "KB";
	_root.percentdone = _parent.percent_done + "%";
	_root.bar.gotoAndStop(_parent.percent_done);
	if (_parent.loaded_bytes == _parent.total_bytes) {
		set(_root.container._alpha, 100);
	}
}

```
