Testing a movie > Authoring and scripting guidelines > Using good scripting practices

 

Using good scripting practices

It's a good idea to follow these scripting practices:

Use the trace action to send information to the Output window. (See Using the trace action.)

Use the comment action to document how your ActionScript is supposed to work.

Use consistent naming conventions to identify elements in a script. Start variable and function names with a lowercase letter and use a capital letter for each new word (myVariableName, myFunctionName). Start constructor function names with a capital letter (MyConstructorFunction). Most important, pick a style that makes sense to you and use it consistently.

Use meaningful variable names that reflect what kind of information a variable contains. For example, a variable containing information about the last button pressed could be called lastButtonPressed. A name like foo would make it difficult to remember what the variable contains.

Use the Movie Explorer to view the display list and view all ActionScript scripts in a movie. See Using the Movie Explorer.