Simple preloader

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.

You can’t :stuck_out_tongue:

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

pom :asian:

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

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 :slight_smile:

Cheers!

pom :asian:

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.

What was wrong with it?

pom :asian:

Everything was great, but I would like to have preloader whithout “bytes” I just want simple line. Can you help me? Please…:frowning:

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
:slight_smile:

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.

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

pom :asian:

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((nPercentLoaded
5)+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

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

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

-Tom

I have one problem my zip program isn’t working so I will give you my email [email protected] . Write me back and I will attach you full fla file.