# Preloader gets preloaded?!

**URL:** <https://forum.kirupa.com/t/preloader-gets-preloaded/59841>\
**Category:** flash\
**Created:** [August 4, 2004, 8:51am UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841 "2004-08-04T08:51:31Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kajinku](https://avatars.discourse-cdn.com/v4/letter/k/94ad74/32.png) [@Kajinku](https://forum.kirupa.com/u/Kajinku)\
**Post date:** [August 4, 2004, 8:51am UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/1 "2004-08-04T08:51:31Z")

</div>

Hello all,

I’ve tried 5 different preloaders and none of them seem to work correctly. The problem I’m having is that I get a blank screen when the movie is actually preloading. When it’s finished, I get to see a second of the preloader bar and it continues the movie, like if the preloader itself got preloaded.

The first frame(s) are for the preloader only. Then the movie starts with a piece of AS (for music) and the animations.

What am I doing wrong? Any ideas?

Thanks!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2004, 8:55am UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/2 "2004-08-04T08:55:21Z")

</div>

Do you use any components or do you have other mc\s that are exported to 1st frame?

If so, do a search on ‘preload export first frame’ and I’m sure you’ll find the info you need 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2004, 9:03am UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/3 "2004-08-04T09:03:55Z")

</div>

I use the standard scroll bar as a component, but it’s not in the first frame. Like I said, the first frame(s) are for the preloader only (some preloaders require 1 frame, others 2 or 3 or whatever, depending on how the preloader is made).

My actual movie starts from frame 6 with some AS and no animations. Animations start from frame 8.

Is that what you meant?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2004, 9:40am UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/4 "2004-08-04T09:40:49Z")

</div>

this happens to me occasionally, too. In my case, it’s caused by me exporting all my sounds on the first frame of a movie.

I get around it by having a seperate movie that is purely a preloader. This movie then loads the main movie, and voila! the preloader works again.

I’ve seen a few tutorials on this, but I can’t remember where.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2004, 10:05am UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/5 "2004-08-04T10:05:08Z")

</div>

ARGH! I’m all confused now. :crazy:

OK, I read some stuff about streaming sound and preloaders. I disabled the option “export on first frame” using the Linkage thingy of my music in the library. I want the music to preload as well though, so, here’s my code:

```auto

mySound = new Sound();
mySound.loadSound([http://www.domain.com/folder/music.mp3](http://www.domain.com/folder/music.mp3),false);
bytes_loaded = Math.round(_root.getBytesLoaded() + mySound.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal() + mySound.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._width = getPercent*100;
_root.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
 
 _root.gotoAndPlay(3);
 
}

```

The result: the bar loads and freezes at 100%. What am I doing wrong now?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2004, 12:45pm UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/6 "2004-08-04T12:45:49Z")

</div>

No one? Pretty please… 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2004, 9:34pm UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/7 "2004-08-04T21:34:53Z")

</div>

_boing_

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2004, 10:36pm UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/8 "2004-08-04T22:36:51Z")

</div>

> [@Kajinku](#):
>
> _boing_

I`m just baffled as to why you are trying to preload sound which you want to stream.  
streaming sounds are preloaded 5 seconds worth by default. If you  
need it to preload more than that you have to modify the internal flash  
variable \_soundbufTime  
If you want to preload 10 seconds of sound data instead of 5:

\_soundbuftime = 10;

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 5, 2004, 7:35am UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/9 "2004-08-05T07:35:02Z")

</div>

OK, I think I misunderstood a couple of things or/and didn’t make myself clear. It happens when I’m writing in English. 😉 Let me start again:

I have a simple preloader with a %-bar that has to preload a small movie with music. The music doesn’t have to stream really, just play when the AS kicks in, which it did. The sound is “exported for AS” and “exported on first frame”. The problem I have is that the preloader doesn’t show up at the beginning of the movie, while preloading. The screen remains blank for a while until everything is preloaded. That’s not what I want. I want the user to _see_ the preloader bar while waiting for the preloader to preload.

I searched the forum and found some similar problems people were having, with a few differences here and there. Apparently this is a common preloader problem. Anyway, I tried some stuff: I disabled the sound’s “export on first frame”. Without this option, my movie preloads like it has to. I can see the bar and the % and everything. When it hits 100%, the movie begins. There’s a “but” though: the music doesn’t get preloaded anymore.

Once again, the music I have is triggered by ActionScript. I don’t know if that’s the problem or not, but it drives me crazy.

Thank you. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 5, 2004, 12:23pm UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/10 "2004-08-05T12:23:21Z")

</div>

> [@Kajinku](#):
>
> OK, I think I misunderstood a couple of things or/and didn’t make myself clear. It happens when I’m writing in English. 😉 Let me start again:
> 
> I have a simple preloader with a %-bar that has to preload a small movie with music. The music doesn’t have to stream really, just play when the AS kicks in, which it did. The sound is “exported for AS” and “exported on first frame”. The problem I have is that the preloader doesn’t show up at the beginning of the movie, while preloading. The screen remains blank for a while until everything is preloaded. That’s not what I want. I want the user to _see_ the preloader bar while waiting for the preloader to preload.
> 
> I searched the forum and found some similar problems people were having, with a few differences here and there. Apparently this is a common preloader problem. Anyway, I tried some stuff: I disabled the sound’s “export on first frame”. Without this option, my movie preloads like it has to. I can see the bar and the % and everything. When it hits 100%, the movie begins. There’s a “but” though: the music doesn’t get preloaded anymore.
> 
> Thank you. 🙂

This last thing you tried,leave it like this,create a dummy frame never seen by your viewers between the preloader and the main movie and drag an instance of the sound into this.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 5, 2004, 12:46pm UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/11 "2004-08-05T12:46:40Z")

</div>

> [@stringy](#):
>
> This last thing you tried,leave it like this,create a dummy frame never seen by your viewers between the preloader and the main movie and drag an instance of the sound into this.

Ah, it works, thank you!! :thumb:

I have a bonus question though. 😉  
The AS that controls the music at the beginning of the movie is in frame 6. I first put the instance of the sound on frame 4, which worked as well, but with the sound being “duplicated” when it played. So I put the instance in a new layer, in a frame just above the frame where the AS does its thing. Works like a charm.  
Now my question: do I always have to put it on the same “level” or can I set up the instance so that it doesn’t play by itself?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 5, 2004, 1:00pm UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/12 "2004-08-05T13:00:05Z")

</div>

> [@Kajinku](#):
>
> Ah, it works, thank you!! :thumb:
> 
> I have a bonus question though. 😉  
> The AS that controls the music at the beginning of the movie is in frame 6. I first put the instance of the sound on frame 4, which worked as well, but with the sound being “duplicated” when it played. So I put the instance in a new layer, in a frame just above the frame where the AS does its thing. Works like a charm.  
> Now my question: do I always have to put it on the same “level” or can I set up the instance so that it doesn’t play by itself?

Not sure i properly understand your “bonus question”. What i do,is-  
frame1-preloader code- if(blahblah && blah){  
this.gotoAndStop(3);  
}  
frame 2- sound instance-never visits this frame.  
frame3-movie

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 5, 2004, 1:00pm UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/13 "2004-08-05T13:00:19Z")

</div>

OOPS, don’t answer that last “bonus” question, I found the solution. Sometimes I don’t see stuff that are just in front of my eyes. Must be the warm weather.

Anyway, thanks again!! 🙂

EDIT: I was too late, you answered it anyway. 😉 I just put the instance on “stop” so that it didn’t play by itself.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 10, 2004, 3:47pm UTC](https://forum.kirupa.com/t/preloader-gets-preloaded/59841/14 "2004-08-10T15:47:30Z")

</div>

Kajinku, you might want to do that code onEnterFrame to UPDATE IT as the sound is loaded…
