Introduction to ActionScript3

ActionScript is case sensitive: The first important thing to remember as you work with ActionScript is that it is case sensitive. That means that if the instructions say to type gotoAndPlay(2); it must be all lower case letter except for the 'A' and 'P'. If you type GOTOANDPLAY(2); or any other combination of upper and lower case letters, It will not work.

Punctuation is Important: Every statement in ActionScript ends with a semi-colon ; Every block of code is surrounded by curly braces { } ActionScript also uses parenthesis ( ), brackets [ ] and other punctuation. All punctuation must be copied exactly.

ActionScript uses parenthesis (), braces {}, and brackets []. They are not interchangeable! Every brace { must have a matching }. The same is true of parenthesis: ( ) and brackets [ ].

You need Names: If you want to refer to a movie clip, activate a button, or display text, you must be able to call it by a name. You give it a name in the properties window. The name of a movie clip or anything else must follow these rules:

  1. If cannot have any spaces!
  2. It must start with a letter, then it can have more letters and digits or an underscore. A name can not have any other special characters.
  3. The name must be unique, if you name a MovieClip star, then the name star can not be used to name anything else.
  4. Good names usually use what is sometimes called "camel case": it starts with a lower case letter and then capitalizes each word in the name: badDude or bigBug. Picking good descriptive names and being consistent in how you name things will make your work easier later.

NEXT: Naming Movie Clips