Code Hinting

The Flash MX ActionScript Editor supports code hinting and code completion to help you script your applications. Table 12.2 provides a complete list of the Communication object suffixes that will automatically invoke the code hint and code completion tools. As a convenience, the entire scope of ActionScript suffixes are listed in the table.

These suffixes are not just useful for code hinting; use them for all your code to help self-document it. Understanding what type of data is stored within the variable will help you debug any application you create. Suffixes are added to the end of ActionScript variable names. For example, consider a variable name that might be used for a RecordSet object. The variable name myDatabaseData does not invoke code hints in the ActionScript Editor, but myDatabaseData_rs invokes the code hint for the object in both Flash MX and Dreamweaver MX (if you used Dreamweaver to edit Flash or server-side ActionScript).

Table 12.2. ActionScript Suffixes to Enable Code Hints

COMMUNICATION OBJECT CODE HINT SUFFIXES

Object Type

Suffix String

Var Example

Suffix String

Camera

_cam

NetServices

NetServices

Video

_video

NetStream

_ns

LocalConnection

_lc

RecordSet

_rs

Microphone

_mic

SharedObject

_so or SharedObject

NetConnection

_nc or _conn

   

REGULAR ACTIONSCRIPT CODE HINT SUFFIXES

Object Type

Suffix String

Var Example

Suffix String

MovieClip /

_mc

Date Object

_date

Communication UI component

     

Array

_array

Sound Object

_sound

String

_str

XML Object

_xml

Button

_btn

XML Socket Object

_xmlsocket

Text field (including input)

_txt

Color Object

_color

FLASH UI COMPONENTS CODE HINT SUFFIXES_CH

Object Type

Suffix String

Var Example

Suffix String

CheckBox Object

_ch

Scrollbar Object

_sb

PushButton Object

_pb

Checkbox Object

_cb

RadioButton Object

_rb

Scroll Pane Object

_sp

ListBox Object

_lb

globalStyleFormat

globalStyleFormat



    Part I: 10 Quick Steps for Getting Started