# Preloader problems :(

**URL:** https://forum.kirupa.com/t/preloader-problems/130119
**Category:** Uncategorized
**Created:** [December 1, 2004, 5:57pm UTC](https://forum.kirupa.com/t/preloader-problems/130119 "2004-12-01T17:57:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![eberline\_b](https://avatars.discourse-cdn.com/v4/letter/e/85f322/32.png) [@eberline\_b](https://forum.kirupa.com/u/eberline_b)
#### Post date: [December 1, 2004, 5:57pm UTC](https://forum.kirupa.com/t/preloader-problems/130119/1 "2004-12-01T17:57:47Z")

</div>

Hey guys,

I’m trying to preload a bunch of swf’s and audio files. I got the preloader to preload 20% of each external swf and audio file which load together. However, even after the preloading, the swf takes a couple seconds to load and consequently is not in sync with the audio. Could this be b/c the swf is 1.3 mg large? I would think that preloading 20% of a file would allow for full streaming eventhough the files is so large.

Any ideas on how to make my swf sync with my audio?

code:

stop();  
createEmptyMovieClip(“parent”, 1);  
parent.createEmptyMovieClip(“child”, 1);  
parent.child.loadMovie(“bc\_updated.swf”);  
parent.\_visible = false;

myMusic = new Sound();  
myMusic.loadSound(“bill\_bcscanner\_updated.mp3”, true);  
myMusic.setVolume(0);

this.onEnterFrame = function(){

var downloadSize = parent.child.getBytesLoaded();  
var totalSize = parent.child.getBytesTotal();

var downloadsongSize = myMusic.getBytesLoaded();  
var totalsongSize = myMusic.getBytesTotal();

trace("downloadSize = " + downloadSize);  
trace("totalSize = " + totalSize);  
trace(“downloadsongSize =” + downloadsongSize);  
trace(“totalsongSize =” + totalsongSize);

percentLoad = 100 \* kBytesLoaded / kBytesTotal;  
percentRemaining = 100 - percentLoad;  
getPercent = downloadsongSize/totalsongSize;  
this.loadText = Math.round(getPercent\*100)+"%";

```
if(totalSize &gt; 0 && downloadSize &gt; 313929) {

```

trace(“eurka”);  
trace(“eurka”);  
trace(“eurka”);  
if(totalsongSize \> 0 && downloadsongSize \> 148736) {  
trace(“euuuuuureeeka”);  
ifFrameLoaded(“bc”){  
trace(“frame loaded”);  
gotoAndPlay(“bc”);  
delete this.onEnterFrame;  
}  
}  
}

```
 }

```

thanks.
