# Flash MX Pre-loader

**URL:** <https://forum.kirupa.com/t/flash-mx-pre-loader/776>\
**Category:** flash\
**Created:** [July 29, 2002, 7:43pm UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776 "2002-07-29T19:43:31Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![cleoandczar](https://avatars.discourse-cdn.com/v4/letter/c/6bbea6/32.png) [@cleoandczar](https://forum.kirupa.com/u/cleoandczar)\
**Post date:** [July 29, 2002, 7:43pm UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/1 "2002-07-29T19:43:31Z")

</div>

Need help with a pre-loader. The entire movie downloads before the pre-loader starts. Making it pointless to have a preloader. My site is www.cleoandczar.tk If you know how to help I could send you the .fla

---

<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:** [July 29, 2002, 11:49pm UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/2 "2002-07-29T23:49:36Z")

</div>

cleoandczar

Your preloader worked fine on my end. You probably have the flash file in your cache (because you have loaded the page at least once)- enabling your page to load quick enough not to need the preloader. Very nice site. I love the star burst effect- is that script available?

---

<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:** [July 30, 2002, 3:33am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/3 "2002-07-30T03:33:29Z")

</div>

Thanks for the compliment. I took a look at you site and it starts the preloader right away. Very Nice. Mine, I have to tell friends to wait 2min on a plain blue screen until the pre-loader loads. I tried to contact you from your site to send you my .fla source we will see if you can get an 8MB file

---

<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:** [July 30, 2002, 5:25am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/4 "2002-07-30T05:25:53Z")

</div>

cleoandczar

No email yet. 8 MB should not be a problem. Try zippping just in case.

You are right. I cleared my cache and I get a blue screen first. I must have missed it the first time.

Craig

---

<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 2, 2002, 5:35am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/5 "2002-08-02T05:35:30Z")

</div>

I sent the .fla to you again let me know if you got it

www.CleoAndCzar.tk

---

<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 2, 2002, 6:55am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/6 "2002-08-02T06:55:50Z")

</div>

Check it out now I think I fixed the problem I set my first sceen to start and set the first part of the intro to loop untill the whole movie is downloaded

www.CleoAndCzar.tk 🙂

---

<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 2, 2002, 7:20am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/7 "2002-08-02T07:20:58Z")

</div>

Oh man Cleo! I have been having the exact same problem, as has david! My screen doesn’t show anything until the movie is like 70% loaded! What the heck is going on with mine? And what did you do to fix this? I don’t understand what this means:

> Check it out now I think I fixed the problem I set my first sceen to start and set the first part of the intro to loop untill the whole movie is downloaded

It would be great if you could help me out as this is the last thing I need to fix before [someoneleet.com](http://someoneleet.com) goes online!

Thanks!  
-brad-

---

<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 2, 2002, 10:49am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/8 "2002-08-02T10:49:58Z")

</div>

try this code

if (!zInit) {  
createEmptyMovieClip(“mcBorders”, 2);  
createEmptyMovieClip(“mcProgress”, 1);  
mcBorders.lineStyle(2, 0x0000ff, 100);  
mcBorders.moveTo(25, 180);  
mcBorders.lineTo(25, 220);  
mcBorders.moveTo(525, 180);  
mcBorders.lineTo(525, 220);  
mcBorders.zInit = true;  
}  
\_root.nPercentLoaded = (\_root.getBytesLoaded()/\_root.getBytesTotal())_100;  
\_root.nXround = (Math.ceil(nPercentLoaded/20))20;  
mcProgress.beginFill(0xff0000,100);  
mcProgress.moveTo(25, 190);  
mcProgress.lineTo((nPercentLoaded5)+25, 190);  
mcProgress.lineTo((nPercentLoaded_5)+25, 210);  
mcProgress.lineTo(25, 210);  
mcProgress.endFill();  
if (\_root.nPercentLoaded\<100) {  
gotoAndPlay(\_currentframe-1);  
} else {  
removeMovieClip(\_root.mcBorders);  
removeMovieClip(\_root.mcProgress);  
}

this is set up for normal stage size create a new layer and insert 2 keyframes in that layer b4 the movie starts on the oter layer but the code on the second frame  
it has a loading bar nothing special but it works

-Tom

---

<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 2, 2002, 6:36pm UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/9 "2002-08-02T18:36:35Z")

</div>

Thank you very much for your reply novatake. However, my first choice is to continue with my preloader and fix it, as Cleo did. I already have some code and also animations for my loading scene. However, if I can not fix it then I will end up using yours.

Thanks!  
-brad-

---

<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 2, 2002, 6:39pm UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/10 "2002-08-02T18:39:39Z")

</div>

dont mention it mate A lad posted that on kirupacant remember who though i use that if im makin a big full size 1 but if i make a little 1 i make my own

---

<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 3, 2002, 3:39am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/11 "2002-08-03T03:39:41Z")

</div>

1. Select all of the frames in your Pre-load scene.  
 ![](http://members.cox.net/cleoandczar/select.jpg)
2. In your properties switch your Sync selector to Start  
 ![](http://members.cox.net/cleoandczar/start.jpg)
3. Apply an action script to one of your frames in your in your preloader similar to this

line 1 stop();  
line 2 var loaded=false;  
line 3 ifFrameLoaded (“main”, 17){  
line 4 var loaded=true;  
line 5 gotoAndPlay(28);  
line 6 }  
line 7 if(loaded==false){  
line 8 gotoAndPlay(1);  
line 9 }

line 1 I stop the movie to evaluate my script

line 2 I set a variable

line 3 I check to see if my last frame is loaded in my main frame

line 4 if 3 was true set variable

line 5 I play the next frame in the current sceen

line 6 & 7 if the variable I set was not changed I play my pre-load sceen again

www.CleoAndCzar.tk

---

<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 3, 2002, 3:59am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/12 "2002-08-03T03:59:27Z")

</div>

Hey thanks Cleo, a couple of questions.

1. Does it matter which frame I place this actionscript in?

2. In line 3, where you designate the last frame in your main movie, I can replace this with my Scene1, which is my main movie scene, and then the last frame in Scene1, correct?

3. In line 4, you go to the last line in the preloader, where it then goes to the main movie, correct?

Thank you very much for your help cleo! I appreciate it very much!

Thanks!  
-brad-

---

<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 3, 2002, 6:45am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/13 "2002-08-03T06:45:28Z")

</div>

Sorry cleo nevermind about those questions. OK all I figured out how to do it and I added the AS to a frame. However, it still didn’t work for me. Everytime the loader and the background shows up when the movie is 72% loaded. I thought about why it wasn’t working and realized I load with totalK and not framesLoaded. So, trying to think along the same lines as you did, I entered these lines of AS instead of the others:

stop();  
if ((getBytesLoaded()/1024)\>=(getBytesTotal()/1024) && (getBytesTotal()/1024) != 0) {  
gotoAndPlay(16);  
} else {  
gotoAndPlay(1);  
}

However, this got me nowhere as well. I am wondering if someone could take a look at my .fla and see what they can come up with. I am really struggling with this.

Thanks!  
-brad-

---

<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 3, 2002, 6:49am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/14 "2002-08-03T06:49:19Z")

</div>

Hey, just trying to help you all out I will paste what I have for the preloader. In my first frame, this is the code I have:

totalK = Math.floor(getBytesTotal()/1024);  
loadedK = Math.floor(getBytesLoaded()/1024);  
remainingK = totalK-loadedK;  
percentageK = Math.floor((loadedK/totalK)\*100)+"%";  
if ((getBytesLoaded()/1024)\>=(getBytesTotal()/1024) && (getBytesTotal()/1024) != 0) {  
gotoAndPlay(3);  
}

And in the second frame this is what I have:

gotoAndPlay(1);

Hope this helps.  
-brad-:ninja:

BTW: The AS that takes the user to the main scene is at frame 16. This is because I have some animations that take place after the loading is complete.

---

<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 3, 2002, 7:05am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/15 "2002-08-03T07:05:59Z")

</div>

\*\*Can you post your site address, so we can all take a look.🙂 \*\*

---

<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 3, 2002, 7:38am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/16 "2002-08-03T07:38:25Z")

</div>

No problem. However, it loads kinda fast on a broadband connection so you might not be able to see it. I posted it temporarily here:

[Bad Loader](http://www.someoneleet.com/home.html)

Thanks!  
-brad-

---

<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 3, 2002, 8:05am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/17 "2002-08-03T08:05:23Z")

</div>

**HOLY ■■■■**

Do you work for that company that you have listed in your site  
[http://www.whoswe.com](http://www.whoswe.com)  
I have never seen anything like that before.  
Even with all of my skills as a programmer  
Java  
JavaScript  
HTML  
DHTML  
SQL  
Oracle  
PEGA  
Graphics Design  
and now A little Flash  
**I feel like I know nothing 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 3, 2002, 8:14am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/18 "2002-08-03T08:14:52Z")

</div>

No it is not his site…but I am sure Ben wished it was!

---

<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 3, 2002, 8:36am UTC](https://forum.kirupa.com/t/flash-mx-pre-loader/776/19 "2002-08-03T08:36:48Z")

</div>

LOL my name is Brad, and yes I do wish WhosWe was my site. But can anyone help me with my preloader?

Thanks!  
-brad-
