FLASH CS3
User Guide
392
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.
Format code
Your code can be formatted and indented automatically or manually. If you use dynamic font mapping, you ensure
that the correct fonts are used for multilingual text.
Set Auto Format options
1
Do one of the following:
•
From the panel menu
(at the upper-right corner of the Actions panel), select Preferences.
•
In the Script window, select Edit > Preferences (Windows) or Flash
> Preferences (Macintosh).
Error
_err
LoadVars
_lv
LocalConnection
_lc
Microphone
_mic
MovieClip
_mc
MovieClipLoader
_mcl
PrintJob
_pj
N
etConnection
_nc
N
etStream
_ns
SharedObject
_so
Sound
_sound
String
_str
TextField
_txt
TextFormat
_fmt
Video
_video
XML
_xml
XML
N
ode
_xmlnode
XMLSocket
_xmlsocket
Object type
Variable suffix