# Need a little help tweaking my preloader code

**URL:** <https://forum.kirupa.com/t/need-a-little-help-tweaking-my-preloader-code/158267>\
**Category:** Uncategorized\
**Created:** [August 8, 2005, 6:06pm UTC](https://forum.kirupa.com/t/need-a-little-help-tweaking-my-preloader-code/158267 "2005-08-08T18:06:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgomez03](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mgomez03](https://forum.kirupa.com/u/mgomez03)\
**Post date:** [August 8, 2005, 6:06pm UTC](https://forum.kirupa.com/t/need-a-little-help-tweaking-my-preloader-code/158267/1 "2005-08-08T18:06:00Z")

</div>

My main .swf file is 3 frames with the preloader residing in frame 1. I’m trying to get my preloader to skip frame 2 and jump straight to frame 3 if it’s already cached… otherwise, go to and stop at frame 2 if it has not.

Why would I want it to do that? I have a little movie clip on frame 2 that lets the user know that loading is complete but I’m noticing it’s always popping up everytime the movie is run – I only want that movie clip on frame 2 to appear when it’s loaded for the very first time. I’ve been using this code so far:

```auto

onClipEvent (enterFrame) {
	loading = _parent.getBytesLoaded();
	total = _parent.getBytesTotal();
	percent = ((loading / total) * 100);
	current = int(percent) + "%";
	if (loading == total) {
		_parent.gotoAndStop (3);
	} else {
		if (percent > 99) {
			_parent.gotoAndStop(2);
		}
	}
}

```

I’m guessing my problem is that it’ll never skip frame 2 and always go to frame 2 followed by 3 regardless because both arguments eventually reach a fully loaded state. I thought about using somekind of loop but not exactly sure how that would solve things. Any suggestions?
