EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 50

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
50 Writing and Editing ActionScript 2.0
About using comments to trigger code hints
You can also use ActionScript comments to specify an object’s class for code hints. The
following example tells ActionScript that the class of the
theObject instance is Object, and so
on. If you were to enter
mc followed by a period after these comments, code hints that display
the list of MovieClip methods and properties would appear. If you were to
enter
theArray followed by a period, a menu that displays a list of Array methods and
properties would appear, and so on.
// Object theObject;
// Array theArray;
// MovieClip theMc;
However, Macromedia recommends that instead of this technique, you use strict data typing
(see About typing objects to trigger code hints” on page 48) or suffixes (see About using
suffixes to trigger code hints” on page 48) because these techniques enable code hints
automatically and make your code more understandable. For more information on using code
hints, see “Using code hints” on page 45.
Formatting code
You can specify settings to determine if your code is formatted and indented automatically or
manually. In addition, you can select whether to use dynamic font mapping, which ensures
that the correct fonts are used when working with multilingual text.
To set format options:
1. In the Actions panel, select Preferences from the pop-up menu (at the upper right of the
Actions panel). In the Preferences dialog box, select Auto Format.
Alternatively, in the Script window, select Edit > Preferences (Windows) or Flash >
Preferences (Macintosh). In the Preferences dialog box, select Auto Format.
2. Select any of the Auto Format options.
To see the effect of each selection, look in the Preview pane.
After you set Auto Format options, your settings are applied automatically to code you write,
but not to existing code; you must apply your settings to existing code manually. You must
manually format code that was formatted using different settings, code that you imported
from another editor, and so on.

Table of Contents

Related product manuals