48 Writing and Editing ActionScript 2.0
2. Do one of the following:
■ Click Show Code Hint in the Actions panel or Script window toolbar.
■ Press Control+Spacebar (Windows) or Command+Spacebar (Macintosh).
■ If you are working in the Actions panel, select Show Code Hint from the pop-up
menu.
About typing objects to trigger code hints
When you use ActionScript 2.0, you can use strict typing for a variable that is based on a
built-in class, such as Button, Array, and so on. If you do so, the Script pane displays code
hints for the variable. For example, suppose you type the following code:
var names:Array = new Array();
names.
As soon as you type the period (.), Flash displays a list of methods and properties available for
Array objects in a pop-up menu, because you have typed the variable as an array. For more
information on data typing, see “About assigning data types and strict data typing”
on page 81. For information on using code hints when they appear, see “Using code hints”
on page 45.
About using suffixes to trigger code hints
If you use ActionScript 1 or you want to display code hints for objects you create without
strictly typing them (see “About typing objects to trigger code hints” on page 48), you must
add a special suffix to the name of each object when you create it. For example, the suffixes
that trigger code hinting for the Array class and the Camera class are
_array and _cam,
respectively. For example, if you type the following code
var my_array = new Array();
var my_cam = Camera.get();
you can type either of the following (the variable name followed by a period):
my_array.
my_cam.
Code hints for the Array and Camera objects will appear.
For objects that appear on the Stage, use the suffix in the Instance Name text box in the
Property inspector. For example, to display code hints for MovieClip objects, use the Property
inspector to assign instance names with the
_mc suffix to all MovieClip objects. Then,
whenever you type the instance name followed by a period, code hints appear.
Although suffixes are not required for triggering code hints when you use strict typing for an
object, using suffixes consistently helps make your code understandable.