YomToxic ALWAYS delivers.
Okay, so you've made little flipbooks and frame-by-frame animations and think you're pretty sweet stuff, right?
... no?. What, you want more?. Okay then!. I guess you wanna know how to make something more advanced... like preloaders, and other random shit, right?.
Well, let's stop yapping and get to it, fucknuts!
Welcome to Part 3 of this small series!. I know most of you are cheap jews who can't afford the program, but who gives a fuck?. ROLL IT!
What you'll be learning to do today.
1) Variables
2) Forks
3) Simple Preloaders
4) Masturbating with your toes.
Yup, this one's an actionscript 2 rampage! If your have less than 100IQ... GTFO!. LOL!!!.
----
1) Variables.
What the fuck is a variable?. It's a random, changeable value.
You don't get it?.
That's a device with multiple possible values, from 1-5. That's how it is - you can change these motherfuckers to any value you need!.
How do we create/change variables?.
[img6]
You remember what we did with Actions some time back, right? No? YOU SUCK!
What I did there was click the first frame and hit F9, bringing up the actions window. This is where the magic begins; any code that has no errors will be executed when this frame is played.
I entered
magicgood = 1
yourname = "Idiot"
Notice the difference between inputting text and numbers?. Keep that in mind.... if you have any left from the brutal rape that ensued at Satan's place!
You've just created your first variables!. If you're not a stupid fuck, you'll realize that you set magicgood to 1 and yourname to read Idiot.
What good are these for if you can't display them?. Good question!.
Click on the text button. Uh huh, yeah, that droll tool you use to write FUCKING TEXT on your flash canvas. Create a new keyframe. You should now have two keyframes. Click frame 1, and enter the following stop(); and then, right below it... magicgood = 0
Do the same for frame #2.
Now use some buttons to make it possible to flip back and forth the frames.
Done? Now go to frame 1 and click the insert text tool... and just make an empty text box. If you want, you can use LAYERS to place a light gray rectangle area at the back to mark the text box.
Now, click on the text box and check out the properties box to the right.
Direct your attention to the dropdown box that now has 'static text'. Static text is of no interest to you now, so click it again. Now, you want to input variables, right?. Good! Select Input Text.
If you wanted a space to insert random shit in there, you'd stop reading now. What, variables? Ok! Pay attention!
Upon selecting input text from the drop down box, the properties have changed a bit. There is a new slew of options in 'properties', Max Characters and Variable.
Set the max value to 8, and the variable to magicgood.
You can now input a number up to 8 characters long... and it'll be stored in the variable named 'magicgood'.
Now comes the last bit - displaying variable values.
Now move on to the second frame of your flash, and create a similar text box. Now mark it as 'dynamic text' from the drop down menu. The properties menu changes to incorporate variables. Remember what the name of the variable you want displayed here? magicgood.
Now try inputting a number on the input text and press the button. Whatever you've typed will show up on the next screen.
Good job!. You've learned how to create, store and display variables!.
-
Now it's time to take things up a notch.
'Yes' or 'no'!.
"If or else!"
You want your little creations to take separate ways depending on things, right?.
if (){}else{}
This is the basic instruction set for if/then forks.
Explained.
if (something) {IF something is TRUE, THIS HAPPENS} else {IF is false FALSE, THIS HAPPENS}
The 'something' in the first brackets are usually things like
magicgood > 100 ( variable magicgood is greater than 100 )
A simple list of operands for you to remember...
==
Exact match.
example: _root.percentLoaded==100
<
Number on the left is Smaller than number on the right.
example: 3 < 5
>
Number on the left is Smaller than number on the right.
example: 9 > 6
--
Next up... preloaders!.
Everyone's getting tired of staring at a white screen while your SUPAH AWESOME CHIYO-CHANxMCSLUT HENTAI SLIDESHOW loads, right? You know what to do - preloaders!. Sure, there are some generic ones available from newgrounds or some shit... but fuck that! We're gonna make our OWN preloaders cuz we're stubborn like that!.
One, you need to know how to create, store and display variables AND know how to write proper IF/THEN statements!. That is all!.
Insert two blank keyframes in front of your moovy.
You already know how to set variables, so do this. Open the actions panel in frame 1 and enter the following.
_root.bytesLoaded = _root.getBytesLoaded();
_root.bytesTotal = _root.getBytesTotal();
What, you really want me to explain this?. It's not that hard - it sets the value of the _root.bytesLoaded to how much bytes of your flash has loaded, and the _root.bytesTotal to the total amount (in bytes) of your flash.
k, great.
Now in the next frame, open the actions window and type
if (_root.percentLoaded==100){
gotoAndPlay(3);
}else{
gotoAndPlay(1);}
This creates a loop that basically says if the entire thing isn't downloaded, go back to frame 1. By that time, more bytes will be loaded and the loop will repeat until the movie is loaded and ready to play.
Now, you remember how to display variables in dynamic textboxes?.
Open four textboxes in the first frame.
[Loaded] [_root.bytesLoaded]
[ Total ] [_root.bytesTotal]
The two textboxes on the left are static text. The two boxes on the right are dynamic text with the variables set to each one respectively.
Now you can watch as the bytes are loaded in real-time!. The infinite loop in frame 2 will ensure the flash does NOT move forward until 100% loaded.
.
Well, that's that for this chapter of getting your toes wet with Flash Animation. You've all come far from when you thought Flash was an eldtritch art only the Old Gods could master. If you paid attention, you now are aware of variables, if/then fork/loops and making a preloader!
In the next episode...
Yom is drawfagging again!
"No way! He's really doing it!"
Dustin is posting loli!
"MOTORBIKETIEM!!!"
Will Yom ever find the secret for an increased pernis size?
Or will Reina rise from the ashes and RURE THE WORRD??!?!
Stay tuned for the next episode!