Flash 8 Documentation |
|||
| Learning ActionScript 2.0 in Flash > Writing and Editing ActionScript 2.0 > About coding in the Actions panel and Script window > About code hinting in Flash > About using suffixes to trigger code hints | |||
If you use ActionScript 1 or you want to display code hints for objects you create without strictly typing them (see About typing objects to trigger code hints), you must add a special suffix to the name of each object when you create it. For example, the suffixes that trigger code hinting for the Array class and the Camera class are _array and _cam, respectively. For example, if you type the following code
var my_array = new Array(); var my_cam = Camera.get();
you can type either of the following (the variable name followed by a period):
my_array. my_cam.
Code hints for the Array and Camera objects will appear.
For objects that appear on the Stage, use the suffix in the Instance Name text box in the Property inspector. For example, to display code hints for MovieClip objects, use the Property inspector to assign instance names with the _mc suffix to all MovieClip objects. Then, whenever you type the instance name followed by a period, code hints appear.
Although suffixes are not required for triggering code hints when you use strict typing for an object, using suffixes consistently helps make your code understandable.
The following table lists the suffixes required for support of automatic code hinting:
|
Object type |
Variable suffix |
|---|---|
|
Array |
_array |
|
Button |
_btn |
|
Camera |
_cam |
|
Color |
_color |
|
ContextMenu |
_cm |
|
ContextMenuItem |
_cmi |
|
Date |
_date |
|
Error |
_err |
|
LoadVars |
_lv |
|
LocalConnection |
_lc |
|
Microphone |
_mic |
|
MovieClip |
_mc |
|
MovieClipLoader |
_mcl |
|
PrintJob |
_pj |
|
NetConnection |
_nc |
|
NetStream |
_ns |
|
SharedObject |
_so |
|
Sound |
_sound |
|
String |
_str |
|
TextField |
_txt |
|
TextFormat |
_fmt |
|
Video |
_video |
|
XML |
_xml |
|
XMLNode |
_xmlnode |
|
XMLSocket |
_xmlsocket |
For information on using code hints when they appear, see Using code hints.
Version 8
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00001151.html