# Preloader problem

**URL:** <https://forum.kirupa.com/t/preloader-problem/273823>\
**Category:** Uncategorized\
**Created:** [October 21, 2008, 12:06pm UTC](https://forum.kirupa.com/t/preloader-problem/273823 "2008-10-21T12:06:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phoenix777](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@Phoenix777](https://forum.kirupa.com/u/Phoenix777)\
**Post date:** [October 21, 2008, 12:06pm UTC](https://forum.kirupa.com/t/preloader-problem/273823/1 "2008-10-21T12:06:16Z")

</div>

For a preloader where an 100 frames movie advances as it loads, I used these actions:

stop();  
onEnterFrame = function ()  
{totalBytes = \_root.getBytesTotal();  
loadedBytes = \_root.getBytesLoaded();  
percent = Math.ceil((loadedBytes/totalBytes)\*100);  
\_root.\<\<the instance\>\>.gotoAndStop(percent);  
if (percent=100)  
{play();  
}  
};

If there’s a stop action in a later frame, it is ignored. If I use gotoAndStop(x) instead, if there’s a play button at that frame, it won’t work. What should I do?
