# Simple preloader

**URL:** <https://forum.kirupa.com/t/simple-preloader/937>\
**Category:** flash\
**Created:** [August 3, 2002, 11:48am UTC](https://forum.kirupa.com/t/simple-preloader/937 "2002-08-03T11:48:58Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexsandra](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Alexsandra](https://forum.kirupa.com/u/Alexsandra)\
**Post date:** [August 3, 2002, 11:48am UTC](https://forum.kirupa.com/t/simple-preloader/937/1 "2002-08-03T11:48:58Z")

</div>

Hello,

I am new to flash, so one question rushed into my head. I found a lof of topics about preloaders here, but I want to create very simple preloader without such things like getBitesLoaded and similiar. I want simple preloader which would only show a line without any percents and bytes. Can anyone help me? Write Action Script or explain how to create it without Action Script.

---

<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, 12:20pm UTC](https://forum.kirupa.com/t/simple-preloader/937/2 "2002-08-03T12:20:20Z")

</div>

You can’t 😛

I mean, how are you supposed to make that line if you don’t know how many bytes you’ve loaded?

pom :asian:

---

<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, 12:23pm UTC](https://forum.kirupa.com/t/simple-preloader/937/3 "2002-08-03T12:23:10Z")

</div>

Please explain me how to make preloader i don’t want that everybody see how many bites have to be loaded.☹

---

<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, 1:10pm UTC](https://forum.kirupa.com/t/simple-preloader/937/4 "2002-08-03T13:10:26Z")

</div>

OK, so basically you want a progresss bar, is that it?

And you know, that getBytesLoaded and everything are in the code, you don’t HAVE TO display them if you don’t want to.

Anyway, have you ever done a preloader? If not, check the tutorials here, make one, and then we’ll see what we can do 🙂

Cheers!

pom :asian:

---

<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, 1:13pm UTC](https://forum.kirupa.com/t/simple-preloader/937/5 "2002-08-03T13:13:04Z")

</div>

Thanks for helping me. Actually I have done a preloader once and it was from Kirupa’s lessons, but I don’t want such preloader.

---

<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, 1:20pm UTC](https://forum.kirupa.com/t/simple-preloader/937/6 "2002-08-03T13:20:04Z")

</div>

What was wrong with it?

pom :asian:

---

<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, 1:22pm UTC](https://forum.kirupa.com/t/simple-preloader/937/7 "2002-08-03T13:22:43Z")

</div>

Everything was great, but I would like to have preloader whithout “bytes” I just want simple line. Can you help me? 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 3, 2002, 3:28pm UTC](https://forum.kirupa.com/t/simple-preloader/937/8 "2002-08-03T15:28:08Z")

</div>

I think what Ilyalmasse is trying to say is that to just create a bar the loads according to your movie you have to have getBytesLoaed in your code. Otherwise it won’t work properly, it don’t have to show the getBytesLoaded(); but it will allow for the bar to scale properly in conjunction with your movie that you want to preload. I hope you understand what were trying to say.  
The code would look like this.

//All this is necessary for the code to function properly  
onClipEvent(enterFrame){  
if(\_root.getBytesLoaded () \> 0 && \_root.getBytesLoaded() == \_root.getBytesTotal() )  
\_root.gotoAndPlay(“beginMovie”);  
}else{  
loaded = \_root.getBytesLoaded();  
total = \_root.getBytesTotal();  
percent = int(loaded/total \* 100)  
//Scales the bar to percent, which has to have getBytesLoaded()  
bar.\_xscale = percent;  
}  
}

Hope this helps

Kyle  
🙂

---

<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, 4:36pm UTC](https://forum.kirupa.com/t/simple-preloader/937/9 "2002-08-03T16:36:57Z")

</div>

Thanks for the Action Script a lot, now please help me to do the line. I have tryed to make one : I drew a rectangle with filled it with color. But the fill in rectagle doesn’t change depending on loaded bytes.

---

<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, 5:09pm UTC](https://forum.kirupa.com/t/simple-preloader/937/10 "2002-08-03T17:09:30Z")

</div>

Turn your bar into a movie clip, and give it the INSTANCE NAME ‘bar’ and you’re done.

pom :asian:

---

<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, 2002, 8:54am UTC](https://forum.kirupa.com/t/simple-preloader/937/11 "2002-08-05T08:54:02Z")

</div>

stop the fighting peopleu want a line i give u line

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);  
}

create a new layer drag ur movie across 2 frames then in ur nw layer add this script into the second layer or first im not sure try both out then pressctrl+enter then press it again u shold c a red loader bar

-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 5, 2002, 4:21pm UTC](https://forum.kirupa.com/t/simple-preloader/937/12 "2002-08-05T16:21:33Z")

</div>

Thanks, Tom. I will try to make a preloader in your Action Script.🙂 🙂

---

<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, 2002, 6:49pm UTC](https://forum.kirupa.com/t/simple-preloader/937/13 "2002-08-05T18:49:09Z")

</div>

if you have ne troubl post the fla and ill seti up for you

-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 5, 2002, 7:21pm UTC](https://forum.kirupa.com/t/simple-preloader/937/14 "2002-08-05T19:21:13Z")

</div>

I have one problem my zip program isn’t working so I will give you my email [aleksandrasandra@hotmail.com](mailto:aleksandrasandra@hotmail.com) . Write me back and I will attach you full fla file.
