SITE MOVING

NEW WEBSITE, I've moved everything to a new site. Its not just a blog anymore, its a full blown website.

REPEATE!: its not over just moving!

THE WEBSITE IS:
www.bxstudios.weebly.com

CHECK IT OUT FOR LOTS MORE TUTORIALS!

Welcome To Max's Flash Tutorials!

Here I will eventually post everything I know about flash. That ALOT! I am currently working on one of the best and far most interactive games I've ever made. Its called, "The Burbz RPG" and it will release some time in the summer of 08. That takes up a lot of my time but after I release the game on to the internet I will have a lot more time to write up tutorials.

Sections

Thursday, January 24, 2008

Basic Variable Tutorial

A Variable would be the numerous things that can effect a flash game, maybe its making and editing stats, maybe its buying things, or working an inventory. You can use variables to determine almost any thing, and they're really easy to use. Here I'll show you how to set and modify variables.
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.
Setting Variables:
Setting a variable is MANDATORY in order for the variable to be modified correctly. If you run into your variable being "undefined" or "nan" than you forgot, or misspelled this step.
  1. First You should go to the very first frame of your game or the opening menu
  2. 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:

  1. 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: