When you work in the ActionScript editor, Flash can detect what action you are entering and display a code hinta tooltip containing the complete syntax for that action or a pop-up menu listing possible method or property names. Code hints appear for parameters, properties, and events when you enter certain characters in the ActionScript editor.
Code hints are enabled by default. By setting preferences, you can disable code hints or determine how quickly they appear.When code hints are disabled in preferences, you can turn them on manually.
To enable automatic code hints:
To enable manual code hints in expert mode, do one of the following:
To work with tooltip-style code hints:
(
] after an action name.The code hint appears.
Overloaded functions or methods such as gotoAndPlay
or for
(that is, functions or methods that can be invoked with different sets of parameters) display an indicator that allows you to select the parameter you want to set. Click the small arrow buttons or press Control+Left Arrow key and Control+Right Arrow key to select the parameter.
)
].To work with menu-style code hints:
(
] after an event handler name.)
] if you've already typed an open parenthesis.Many ActionScript objects require you to create a new instance of the object in order to use its methods and properties. For example, in the code myMovieClip.gotoAndPlay(3)
, the gotoAndPlay
method tells the instance myMovieClip
to go to a specific frame and begin playing the movie clip. The Actions panel doesn't know that the instance myMovieClip
is of the object class MovieClip, and therefore doesn't know which code hints to display.
If you want the Actions panel and external editor to display code hints for object instances, you must add a special class suffix to each instance name. For example, to display code hints for the class MovieClip, you must name all MovieClip objects with the suffix _mc
, as in the following examples:
Circle_mc.gotoAndPlay(1); Sqaure_mc.stop(); Block_mc.duplicateMovieClip("NewBlock_mc", 100);
See Naming a variable for a list of code hint suffixes supported by the Actions panel and external editor.
You can also use ActionScript comments to specify an object's class for code hinting. The following example tells ActionScript that the class of the instance theObject
is Object, and so on. If you were to enter mc followed by a period after these comments, a code hint would display the list of MovieClip methods and properties; if you were to enter theArray followed by a period, a code hint would display a list of Array methods and properties, and so on.
// Object theObject; // Array theArray; // MovieClip mc;
Note: This technique works only for built-in classes, not for those defined in external class files.
For more information about object classes in ActionScript, see .