beautypg.com

Adobe Flash Professional CC 2014 v.13.0 User Manual

Page 688

background image

Sound

_sound

String

_str

TextField

_txt

TextFormat

_fmt

Video

_video

XML

_xml

XMLNode

_xmlnode

XMLSocket

_xmlsocket

Comments and code hints

You can also use ActionScript comments to specify an object’s class for code hints. In the following example, a comment tells ActionScript that the
class of the theObject instance is Object, and so on.

// Object theObject;// Array theArray;// MovieClip theMC;

If you subsequently enter theMC followed by a period, code hints that display the list of MovieClip methods and properties appear. If you enter
theArray followed by a period, code hints that display the list of Array methods and properties appear, and so on.

Instead of this technique, however, Adobe recommends that you use strict data typing or suffixes, because these techniques enable code hints
automatically and make your code more understandable.

Specify preference settings for automatic code hints

In the Actions panel or Script window, select Edit > Preferences (Windows) or Flash > Preferences (Macintosh), click Code Editor in the

Category list, and then enable or disable Code Hints.

(Deprecated with Flash Professional CC) Specify a delay for code hints

1. In the Actions panel or Script window, select Edit > Preferences (Windows) or Flash > Preferences (Macintosh).

2. Click ActionScript in the Category list.

3. Use the slider to select an amount of delay, in seconds.

Use tooltip-style code hints

1. Display the code hint by typing an opening parenthesis “(“ after an element that requires parentheses (for example, after a method name, a

command such as if or do..while, and so on).

Opening parentheses invoke the code hints

2. Enter a value for the parameter.

For multiple parameters, separate the values with commas. For functions or statements, such as the for loop, separate the parameters with
semicolons.

Overloaded commands (functions or methods that can be invoked with different sets of parameters) such as gotoAndPlay() or for display an
indicator that lets you select the parameter you want to set. To select the parameter, click the small arrows or press Control+Left Arrow and
Control+Right Arrow.

A code hint with multiple sets of parameters

3. To dismiss the code hint, do one of the following:

681