# \[mx\] help! preloader

**URL:** <https://forum.kirupa.com/t/mx-help-preloader/118306>\
**Category:** Uncategorized\
**Created:** [August 4, 2004, 12:54pm UTC](https://forum.kirupa.com/t/mx-help-preloader/118306 "2004-08-04T12:54:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pucca](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@pucca](https://forum.kirupa.com/u/pucca)\
**Post date:** [August 4, 2004, 12:54pm UTC](https://forum.kirupa.com/t/mx-help-preloader/118306/1 "2004-08-04T12:54:23Z")

</div>

Hi there  
I want to create a preloader (in flash)(with the “percent-loaded”-thingie) for an external .html file that I want to load. Here’s my code:

[color=red]lBytes = \_root.getBytesLoaded();  
tBytes = \_root.getBytesTotal();  
percentLoaded = Math.floor((lBytes/tBytes)\*100);  
loader.bar.\_xscale = percentLoaded;  
loader.percent.text = percentLoaded + "% of " + Math.floor(tBytes/1024) + “K loaded.”;  
if (lBytes\>=tBytes && tBytes\>0) {  
if (count\>=12) {  
gotoAndStop(“main”);  
} else {  
count++;  
gotoAndPlay(“preload”);  
}  
} else {  
gotoAndPlay(“preload”);  
}[/color]

On the “main” frame" I’ve put a getURL action on a movieclip.  
Can this work.??? I’m still new at this and a bit confused? Pls help!!!

---

<div class="post-metadata">

**Author:** ![gunko2](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@gunko2](https://forum.kirupa.com/u/gunko2)\
**Post date:** [August 4, 2004, 1:24pm UTC](https://forum.kirupa.com/t/mx-help-preloader/118306/2 "2004-08-04T13:24:30Z")

</div>

try this link…  
the easiest way to make a preloader…  
[http://www.kirupa.com/developer/mx/percentagepreloader.htm](http://www.kirupa.com/developer/mx/percentagepreloader.htm)

---

<div class="post-metadata">

**Author:** ![pucca](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@pucca](https://forum.kirupa.com/u/pucca)\
**Post date:** [August 4, 2004, 2:40pm UTC](https://forum.kirupa.com/t/mx-help-preloader/118306/3 "2004-08-04T14:40:02Z")

</div>

> [@gunko2](#):
>
> try this link…  
> the easiest way to make a preloader…  
> [http://www.kirupa.com/developer/mx/percentagepreloader.htm](http://www.kirupa.com/developer/mx/percentagepreloader.htm)

Ok, the loader works, but must I put a getURL-action in frame 3? Or how do I “attach” the seperate file? That only explains how to load a movieclip?!!  
Pls help me! And thanks for the previous advise.

---

<div class="post-metadata">

**Author:** ![gunko2](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@gunko2](https://forum.kirupa.com/u/gunko2)\
**Post date:** [August 5, 2004, 6:45am UTC](https://forum.kirupa.com/t/mx-help-preloader/118306/4 "2004-08-05T06:45:29Z")

</div>

well…  
if u put a getURL on the third frame in my opinion (at least that’s what happened to me)… it will open the URL non stop…  
so what u can do is to create another flash page that redirects u to the site it self…  
like:  
“Press Here To Enter The Site”…  
i hope i helped…  
i have a question to u…  
r u trynig to preload an html page?

---

<div class="post-metadata">

**Author:** ![pucca](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@pucca](https://forum.kirupa.com/u/pucca)\
**Post date:** [August 5, 2004, 7:10am UTC](https://forum.kirupa.com/t/mx-help-preloader/118306/5 "2004-08-05T07:10:15Z")

</div>

> [@gunko2](#):
>
> r u trynig to preload an html page?

Yes… is that wrong? Can you do it? I’ve put a .swf file inside a html file…

---

<div class="post-metadata">

**Author:** ![gunko2](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@gunko2](https://forum.kirupa.com/u/gunko2)\
**Post date:** [August 5, 2004, 8:02am UTC](https://forum.kirupa.com/t/mx-help-preloader/118306/6 "2004-08-05T08:02:33Z")

</div>

well thats not hard…  
if i were u i would of placed the preloader in one scene and the the main page that u preload in the next scene…  
and in the third frame of ur preloader write:

```auto

this.gotoAndPlay(nextScene());
or
this.gotoAndPlay("frame_label");
 
 
and in the first frame of the main scene write:
play();
otherwise it will just stop when it goes to the next scene....

```

or u can just put another page in the third frame as i said  
and in that page put a button and some graphics…  
and put a button that says:  
"Press Here To Enter The Site"  
and give the button the action:

```auto

on(release){
    this.gotoAndPlay(nextScene());
}
and again in the first frame of the main scene write:
play();

```

and don’t worry in should preload all the scenes not only the third frame…  
i hope i’ve been helpful…

---

<div class="post-metadata">

**Author:** ![pucca](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@pucca](https://forum.kirupa.com/u/pucca)\
**Post date:** [August 5, 2004, 8:46am UTC](https://forum.kirupa.com/t/mx-help-preloader/118306/7 "2004-08-05T08:46:09Z")

</div>

Thank u soooooo much. I’m gonna try it and come back 2 u!!!
