00:00
00:00
View Profile knuxrouge
Ima omoeba seikai nado nakute Tada, kokoro no mama ni. Kokoro no mama ni. Kimi ga tatoeba inakunatta toshite Sore demo boku no sekai wa tsuduku darou.

Skye @knuxrouge

Age 34, Male

Some place

Nope

Joined on 6/5/07

Level:
24
Exp Points:
5,990 / 6,400
Exp Rank:
7,364
Vote Power:
6.55 votes
Rank:
Police Captain
Global Rank:
4,176
Blams:
631
Saves:
1,504
B/P Bonus:
16%
Whistle:
Deity
Medals:
37

Preloader Tutorial

Posted by knuxrouge - August 28th, 2007


This is a preloader tutorial, I'm not gonna waste time and effort to make a flash, mainly because its a waste of time and effort.

Enjoy.

Step 1. Make a 100 frame movie clip. It must be exactly 100 frames, it can have layers, animation or whatever you want, as long as the timeline ends at 100 frames.

Step 2. Put the Movie clip in the first two frames of the movie. They MUST be in the exact same position, or it'll look really fucked up when loading. An easy method to do this is before the second frame is made, position the movie clip in, then right click the timeline on the second input and put in "Insert Keyframe". Badda bing, badda boom.

Step 3. Make a Blank Keyframe in the third space. Go to "Properties" and where it says <Frame Label>, put in "start".

Step 4. Input the following Italic words in the "Actions" window OF THE FIRST FRAME, not the second frame, nor the movie clip.

totalBytes = Math.round(getBytesTotal()/1024);
loadedBytes = Math.round(getBytesLoaded()/1024);
percentDone = Math.round((loadedBytes/totalBytes)*10 0);
if (_root._framesloaded>=_root._totalfram es) {
gotoAndPlay("start");
}

This means that its rounding up the math, and that on this frame it will show it while counting up the bytes loaded to the total bytes. The total bytes are also divided by the loaded bytes to work up a precentage, explainng the *100. When the bytes loaded is numerically equal to the total bytes, then the movie will goto the frame labeled "start" and play. Be sure that you type in the EXACT way you spelled start, it is case sensitive meaning that if if you named the third frame "Start" and put "start" in the action script, it will not work, because there is an uppercase "S" in the frame label, but a lowercase "s" in the script.

Step 5. Input the following Italic words in the "Actions" window of the second frame.

gotoAndPlay(1);

When the first frame is played it will instantly move on, this makes it so that when it does, the movie will be forced back to the first frame until the loading is complete and then it jumps to the third frame, full-proof, right?

EXTRA STEPS FOR EXTRA EFFORT:
These steps are required if you want the movie clip to go at the same rate as the loading (one frame for 1% loaded, 25 frames for 25% loaded and so on), like how you see a loading bar.

Ex Step 1. Input the following Italic words in the "Actions" window of BOTH of the movie clips (the one in frame 1 and 2)

onClipEvent (enterFrame) {
gotoAndPlay(_root.percentDone);
}

This means, when the movie clip is played, it will enter it and play it frame for % loaded. Remember to put it in both movie clips, because if you put them in just one, then the movie clip won't animate while loading

Thats it!
Was it useful?
You can always see if its working by going to "Control", "Test Movie" and when your at the tested movie, go to "View", "Simulate Download".


Comments

where did you learn actionscript all of a sudden?

Well, I'd be lying if I said that I completely learned action script, but the way I figured this was from a friend who knows a thing or two on flash, he showed me the action script and I figured out wht it meant myself, its common sense if you really look at it.

uhhhh

Dude did you ever think to get a profile pic? Banner? Good icon? Just a thought dude

you should submit it to flash kit or somthing (if you havent already