PDA

View Full Version : Lex0r's Preloader Tutorial [Flash][Actionscript]



V.Valentine
08-27-2005, 04:21 PM
Got permission from Jay that i could post lex0r's preloader tute in a .doc format.

Please do NOT credit me on that or complain to me about what went wrong.

although credit does go to FrAnKeH for searching for it within the google cache.

just dl the file, open it, and read the contents.

Edit: And a heap load of credit to lex0r for taking time to do this.
Edit2: Due to people not having Microsoft i have decided to copy the instructions onto this post.

"This is something that alot of people struggle with so i decided to make this tutorial on how to create your very own preloader.


First off you will need to open flash, so open it.
On the layer that you have rename it:
loadBar

Use the rectangle tool and create a little bar, the legnth you want your loading bar to be.
Making sure that there is NO outline on your bar.
Now select your bar and press F8 to open up the convert to symbol box.
Call it loadBar and make sure that the type of symbol is a 'Movie Clip'
Then set its registration point to the left hand side.

It should look exactly like this:
http://img.photobucket.com/albums/v474/amplifiedteam/pic1.png

Then single click on your new Movie Clip and go into the properties panel. If you can't see your properties panel (at the bottom press Ctrl+F3)
And give the instance a name of loadBar, like this:
http://img.photobucket.com/albums/v474/amplifiedteam/pic2.png

Once that is done create another layout and call it border. Make sure that this new layer (border) is above the loadBar layer.
Then draw around the bar in the new layer with whatever colour you want.

Now we'll leave the loading bar alone for a bit and get started on the percentage text.

Create a new layer and call it loadText, make sure that this layer is above both border and loadBar layers.
Create a text box in the new layer (loadText) and make sure its a Dynamic Text Box, look at this next pic to see how to set this:
http://img.photobucket.com/albums/v474/amplifiedteam/pic3.png

Then give it a Variable Name of loadText like this:
http://img.photobucket.com/albums/v474/amplifiedteam/pic4.png

That is the whole drawing side of the perloader done. Now we'll get to the most trickiest part the programming, which infact isn't as hard as everyone thinks.

Create a new layer and call this layer actions. Then create two new keyframes on the actions layer so there are 3 key frames in all.
Make sure that the other 3 layers span two of them keyframes.
This sounds confusing so heres a screen shot of what I mean:
http://img.photobucket.com/albums/v474/amplifiedteam/pic5.png

Now right click on frame ONE of the the actions layer and select actions, this should make a little box at the bottom of the page appear.
Copy this code into the actions:

bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}


Now right click on frame TWO of the actions layer and put this in the actions box:

this.gotoAndPlay(1);


Then right clcik on frame THREE of the actions layer and put this in the actions box:

stop();


And thats it. Your preloader should now work.
I would go through the code with you, but since its more a thing of copy paste, there is not much point.
If you would like to know what the code means, just let me know and I'll tell you.

Hope it helps people

UPDATE

some people are saying that there loading bar isn't reaching the end of there rectangle well what you need to do is in the code


bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}


the part- this.loadBar._width = getPercent*100;
the 100 is the width of your loading bar at its full legnth, for example if you r loading bar is 200 px wide then you cahnge it to
this.loadBar._width = getPercent*200;

I hope that clears that up


Next update to this first update :)

DA asked me how to make it display the Bytes loaded, well create another layer can call it loadBytes.
Draw another dynamic text box and give it a Variable name of loadBtyes just like the loadText one.

Then in the programming add


this.loadBytes = bytes_loaded+"Bytes";


so your new code should look like this


bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
this.loadBytes = bytes_loaded+"Bytes";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}


There you have it, that now displays the bytes loaded, a loading bar, and a percent loader."

By Lex0r. And here's the .doc file you can dl. It'll soon change into .txt when i have time.

Uplined
03-06-2006, 01:11 AM
Ty i was looking for that tut for ages since the forum came down ;)

kingsecho
03-08-2006, 11:18 AM
It comes up with an error, i dont have microsoft word!!!!!!!!!

V.Valentine
03-08-2006, 12:07 PM
It comes up with an error, i dont have microsoft word!!!!!!!!!
Seriously, every computer should have that, along with Excel, Powerpoint, and other stuff.

What the hell do you do with your H/w without it?
Apart from pen and paper...

52xM
03-08-2006, 12:20 PM
NOTEPAD!!! Bwhahaaahaaaaa!

i'm gonna rate it when i've read it...

EDIT: I think it was alright, well explained. Even though i don't do anything with Flash, so i'm not sure if it's all right.
A lack of pictures is a problem if someone doesen't know anything, but it think they'll get the idea eventually.

so 8/10

yes i'm the wrong person to rate this, but who cares....

Scarecrow
03-08-2006, 10:29 PM
Ty i was looking for that tut for ages since the forum came down ;)

Does anyone realise how big a bump that was? It was like, a year or something... I mean... WTH?

kingsecho
03-09-2006, 09:28 AM
does anybody know were i can get word, from like the internet or such. and i dont do my homework, i cant be bothered.

Mantiscore
03-09-2006, 09:35 AM
Does anyone realise how big a bump that was? It was like, a year or something... I mean... WTH?

Are you uneducated?

You are allowed to bump tutorials, otherwise youd have to make exactly the same thread again to ask questions, compliment and such.

Fuh.

V.Valentine
03-09-2006, 02:09 PM
Are you uneducated?

You are allowed to bump tutorials, otherwise youd have to make exactly the same thread again to ask questions, compliment and such.

Fuh.
I <3 You.
It's lacking pictures because lex0r had deleted those from his photobucket account.

Mantiscore
03-09-2006, 03:15 PM
Aw, i <3 you too.

Ordinair
03-09-2006, 04:05 PM
Well since this topic was already bumped, posting wont be a big deal;

I dont have microsoft word. >_> I know. Its crazy, but I dont. I have "Word Perfect". Care to attach a txt file or any other universal form of text?

V.Valentine
03-10-2006, 01:00 AM
Well since this topic was already bumped, posting wont be a big deal;

I dont have microsoft word. >_> I know. Its crazy, but I dont. I have "Word Perfect". Care to attach a txt file or any other universal form of text?
That or i'll edit the 1st post with the actual instructions.

Scarecrow
03-10-2006, 04:23 PM
Are you uneducated?

You are allowed to bump tutorials, otherwise youd have to make exactly the same thread again to ask questions, compliment and such.

Fuh.

No, not uneducated, just unaware of that fact. I'll take note of that for next time.

stick-fu_man
03-10-2006, 06:08 PM
EEEHA!!!! That's exactly what I wanted!!! Thanks!

kingsecho
03-17-2006, 02:18 PM
Do i now start the animation and put the play button and such in frame 3?

The_Stranger123
04-05-2006, 06:56 PM
the stupid thing starts already loaded.... i dont know what the prob is but someone plz help for God's sake!!!

V.Valentine
04-06-2006, 04:14 PM
the stupid thing starts already loaded.... i dont know what the prob is but someone plz help for God's sake!!!
If you don't know what the problem is, then we can't help you.

@Kingsecho: Yeah, if you want, you can put the play button on the 3rd frame.

The_Stranger123
04-06-2006, 05:08 PM
well it is ur tut....or that other guys....plz help someway! i mean it is just starting at 100% for some reason.... the bar doesnt start at 1% it starts at 100%. just wanna know why....

Scarecrow
04-06-2006, 05:14 PM
It's not his tut. He's just posting it.

sixstrings777
04-07-2006, 06:17 AM
Nice, I was wonderin' how to do that.

Feagond
06-26-2006, 07:45 AM
Well, V. Valentine, I saved you a pair of secīs and converted the tutorial into .txt
Took a lot of time really, ctrl+c in word, ctrl+v in notepad... :biggrin:
Sent it as an attachment
Got a little problem... havenīt got Flash in this PC!!!
lol of me... must try to get it somehow...

vertman
08-08-2006, 02:08 PM
woot i remember when this was made.

*bump*

V.Valentine
08-08-2006, 04:14 PM
I can only remember it being in the Flash Tutorial forums of Old SP...

vertman
08-09-2006, 01:02 AM
Yeah... i borrowed this for one of my tuts with permissions from lex0r...

kirbster40
07-15-2007, 07:36 PM
Thanks! I was looking for this tut for a while :D Google has failed me so i looked here -_-

boogerbag
07-26-2007, 06:43 PM
i did all the things exactly right but it starts at 100 and doesn't even load, i did everything exactly right, ive tried 4 TIMES and it always does the same thing

Draco'X
07-26-2007, 09:48 PM
Good done, you bump-- Oh that's right, it doesn't matter anymore.

Good tut lex0r, whoever you are. It might help me.

FOR THOSE PEOPLE THAT GET THEIR ANIMATIONS STARTED AT 100%:
Dumbasses, since you have it in your computer, it doesn't need loading. You have to upload it in the Intranets to see if it works. It should, unless you did something wrong, which I know will happen, peanut minds.

stick puppet
07-27-2007, 03:26 AM
Wow this is the easiest prelaoder ever!
Nice Tut

Scorpioxxx
07-27-2007, 05:55 AM
Good done, you bump-- Oh that's right, it doesn't matter anymore.

Good tut lex0r, whoever you are. It might help me.

FOR THOSE PEOPLE THAT GET THEIR ANIMATIONS STARTED AT 100%:
Dumbasses, since you have it in your computer, it doesn't need loading. You have to upload it in the Intranets to see if it works. It should, unless you did something wrong, which I know will happen, peanut minds.

Well it does need to load but the size will be so small by the time the loader as loaded the anim will have loaded aswell, if you add music to a blank frame you can see it load on your computer, ie, without uploading it.

pagdog9
08-08-2007, 05:30 PM
I have a problem, when i try to play it it says:

**Error** tempInit : Line 1, Column 10 : [Compiler] Error #1086: Syntax error: expecting semicolon before bar.
var load bar:MovieClip;
ReferenceError: Error #1065: No se ha definido la variable Timeline0_d16ad2f3fa9364bbe863ea1c0188a5.

Lixu
08-10-2007, 03:37 AM
Nice tutorial, keep going lexor.

Scarecrow
08-10-2007, 05:35 AM
Lex0r isn't here any more.

taconaf
06-10-2008, 04:19 PM
omg.. I dont know.. but every time I will make a preloader.. it doesnt works ?
-.-

Lixu
06-11-2008, 10:36 AM
Maybe you have the wrong flash.

taconaf
06-15-2008, 03:23 PM
yea.. probably, what is the flash- version in this tutorial? :D

Lixu
06-16-2008, 08:28 AM
I used Flash 8 and it worked fine.

Hackor Pickel
06-28-2008, 03:53 AM
i like it, i dont underdstand a single bit of it, but i like it.
i'm sure when i understand this "code" it'll become clear lul ;)

kilrb
08-01-2008, 01:35 AM
after the loading bar is gone it doesnt show my animation do i start the animation on the 3rd frame or on the 4th???

xelander
08-06-2008, 05:01 AM
nice tutorial its niiiice :D

connorclockwise
08-10-2008, 03:15 PM
2 things:

1:I feel like I've seen that avatar b4.

2:Thats a good tutorial.

inputfilms
03-23-2009, 01:32 PM
thanks! i needd this..

777FlashMan777
07-11-2009, 10:35 AM
can u make a frame by frame preloader tut like KooKas-Kreations try to do

:Sweating:

Stik_pimp
02-19-2010, 08:17 PM
I figured it out 4 u ppl without microsoft word.right click the .doc on the 1st page then click save target as. Next u go to where ever u saved it on ur pc then right click. Select open with..Then find Notepad.

SOCER214606
02-27-2010, 07:19 AM
Hi i am new to stick page how do i make a video?????

FA break
02-18-2012, 04:33 PM
I've looked at tons of preloaded tutorials, and this the first one that has actually worked for me, thanks whoever made this