# Preloader that loads 50% then plays

**URL:** <https://forum.kirupa.com/t/preloader-that-loads-50-then-plays/74995>\
**Category:** flash\
**Created:** [January 4, 2005, 11:07pm UTC](https://forum.kirupa.com/t/preloader-that-loads-50-then-plays/74995 "2005-01-04T23:07:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason22](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@jason22](https://forum.kirupa.com/u/jason22)\
**Post date:** [January 4, 2005, 11:07pm UTC](https://forum.kirupa.com/t/preloader-that-loads-50-then-plays/74995/1 "2005-01-04T23:07:28Z")

</div>

I want to make a preloader that begins my flash movie once it has 25% or 50% of the swf loaded. This is what I have on my first frame of my preloader right now:  
bytes\_loaded = Math.round(this.getBytesLoaded());  
bytes\_total = Math.round(this.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
loadBar\_mc.\_height = getPercent_179;  
this.loadText = Math.round(getPercent_100);  
if (bytes\_loaded == bytes\_total) {  
this.gotoAndPlay(3);  
}

This works fine and dandy.

I’ve tried:  
bytes\_loaded = Math.round(this.getBytesLoaded());  
bytes\_total = Math.round(this.getBytesTotal()/2);  
getPercent = bytes\_loaded/bytes\_total;  
loadBar\_mc.\_height = getPercent_179;  
this.loadText = Math.round(getPercent_100);  
if (bytes\_loaded == bytes\_total) {  
this.gotoAndPlay(3);  
}

and I’m getting errors.

Can anyone help??
