Helpful Tutorials:
- Ways To Use Variables - A tutorial on all the places where you could put the AS for variable to serve your variable needs.
- First You should go to the very first frame of your game or the opening menu
- There you would apply the following action script:
- var urvariable =1;
- _root.urvariable -=1;
or...
- _root.urvariable =1;
- _root.urvariable=_root.urvariable -1;
Now the variable is set, to make this variable unique to what you want it to do, change "urvariable" to what every name you want it to be. We just set the variable to zero by saying one then subtracting it back down to zero. You must always subract one if you want it to be modified latter. So make sure you set the first number 1 higher than you actually want it to be.
Modifying Variables:
- Now you add this AS to a button or a frame, pretty much where ever you want the variable to change. (Helpful Tutorial)
- _root.urvariable -=1;
or...
- _root.urvariable+=1;
That will add one or subtract one from our variable we set earlier. Dont forget you need the "urvariable" part to be changed but the variable you set and the one your modifying have to have the same name or it will not work.
Another way to add to or subtract from a variable:
- _root.urvariable=_root.urvariable-1;
or...
- _root.urvariable=_root.urvariable+1;
HOW TO VIEW YOUR VARIABLE (IMPORTANT):
- You must place a text box where you would like it to show.
- Make Text Box
- Click Properties
- Change it from "Static Text" to "Dynamic Text"
- Now right in your variable name where it says"Var:"
Now your done and you can test your game/movie.
Similar Tutorials That Would Help You Go Farther In This Subject:
- Ways To Use Variables
- True/False Variables
No comments:
Post a Comment