1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Getting to Know Flash CS5: What Are ActionScript 3.0 Keywords?

By

Getting to Know Flash CS5: What Are ActionScript 3.0 Keywords?
Getting to Know Flash CS5: What Are ActionScript 3.0 Keywords?
Keywords, also known as commands, can be considered the language of Flash. Rather like translating your speech into a foreign language, these keywords translate your intentions into scripts that Flash understands as actions it's supposed to perform. When you know the appropriate keywords, you can communicate with Flash in its own language.

An example of a keyword is the var command. Var tells Flash that the string of characters after the keyword should be defined as a new variable.

In the image above, I've used the var command to define a variable called myvariable; I've used another keyword, int, to set the variable type as an integer. Other examples of keywords include gotoAndPlay, gotoAndStop, stop(), play(), and function.

Keywords commands are already defined within ActionScript 3.0, and can't be used for any other purpose; you can't assign a keyword as a variable name, for example, because then it will stop meaning what it should and will confuse Flash. Just as you can't decide that gracias means horse, you can't name a variable gotoAndPlay; the gotoAndPlay command already has its own meaning in Flash's language, and can't take on a new one.

©2014 About.com. All rights reserved.