# Preloader acting weird! easy if you know how!

**URL:** <https://forum.kirupa.com/t/preloader-acting-weird-easy-if-you-know-how/45838>\
**Category:** Uncategorized\
**Created:** [March 18, 2004, 2:38pm UTC](https://forum.kirupa.com/t/preloader-acting-weird-easy-if-you-know-how/45838 "2004-03-18T14:38:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joecastro](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@joecastro](https://forum.kirupa.com/u/joecastro)\
**Post date:** [March 18, 2004, 2:38pm UTC](https://forum.kirupa.com/t/preloader-acting-weird-easy-if-you-know-how/45838/1 "2004-03-18T14:38:03Z")

</div>

Basically I have a preloader that is a bit fancy. It has a small animated sequence that plays when the percentage bar reaches 100 hence the code below…

if (\_root.percentage1\>99) {  
\_root.loaderbar.gotoAndPlay(2);

(btw the loaderbar has an action that says goto frame 2 on root once it has completed its fancy animation)

Now all is well and dandy BUT **IF** the movie is already in cache the user SHOULDNT see the fancy animated sequence, instead it should just pop along to frame 2 in root.

FIRSTLY - Does anybody know how to do that?

SECONDLY - this is where I am currently…

onClipEvent (load) {  
\_root.totalbytes = \_root.getBytesTotal();  
\_root.bytesloaded = \_root.getBytesLoaded();  
if (\_root.bytesloaded == \_root.totalbytes) {  
\_root.isit = “all loaded”;  
}  
}  
onClipEvent (enterFrame) {  
if (\_root.percentage1\<100) {  
var bytes = \_root.getBytesTotal();  
var bytes\_loaded = \_root.getBytesLoaded();  
\_root.percentage1 = math.floor((bytes\_loaded/bytes)\*100);  
\_root.percentage = +\_root.percentage1+"%";  
if (\_root.percentage1\>99) {  
\_root.loaderbar.gotoAndPlay(2);  
}  
}  
}

many thanks

xx - :tb: joe
