
350
USING FLASH CS4 PROFESSIONAL
ActionScript
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.
See also
Data types
Data type descriptions
Debugging ActionScript 1.0 and 2.0
Debugging your ActionScript 1.0 and 2.0 scripts
The ActionScript 2.0 debugger helps you find ActionScript 1.0 and 2.0 errors while your SWF file runs in Flash Player.
When using Flash to debug ActionScript 1.0 and 2.0, you view your SWF files in the debugger version of Flash Player,
which is installed automatically with Flash. To install a stand-alone debugger version of Flash Player, run the installer
in the /
Flash installed directory
/Players/Debug/ directory.
The ActionScript 2.0 Debugger shows a hierarchical display list of movie clips currently loaded in Flash Player. Using
the ActionScript 2.0 Debugger, you can display and modify variable and property values as the SWF file plays, and you
can use breakpoints to stop the SWF file and step through ActionScript code line by line. You can then go back to your
scripts and edit them so that they produce the correct results.
SharedObject
_so
Sound
_sound
String
_str
TextField
_txt
TextFormat
_fmt
Video
_video
XML
_xml
XMLNode
_xmlnode
XMLSocket
_xmlsocket
Object type
Variable suffix
Updated 5 March 2009