Listing a SWF file's variables
In test mode, the List Variables command displays a list of all the variables currently in the SWF
file. This is especially useful for finding the correct variable target path and variable name. Unlike
the Debugger, the list does not update automatically as the SWF file plays; you must select the
List Variables command each time you want to send the information to the Output panel.
The List Variables command also displays global variables declared with the
The global variables are displayed at the top of the List Variables output in a "Global Variables"
section, and each variable is prefixed with
In addition, the List Variables command displays getter/setter properties—properties that are
created with the
setter property is displayed alongside any other properties in the object it belongs to. To make
these properties easily distinguishable from ordinary variables, the value of a getter/setter property
is prefixed with the string
determined by evaluating the
To display a list of variables in a SWF file:
If your SWF file is not running in test mode, select Control > Test Movie.
1
Select Debug > List Variables.
2
A list of all the variables currently in the SWF file is displayed in the Output panel, as shown in
this example:
Global Variables:
Variable _global.MyGlobalArray = [object #1] [
0:1,
1:2,
2:3
]
Level #0:
Variable _level0.$version = "WIN 6,0,0,101"
Variable _level0.RegularVariable = "Gary"
Variable _level0.AnObject = [object #1] {
MyProperty: [getter/setter] 3.14159
}
Displaying text field properties for debugging
To get debugging information about TextField objects, you can use the Debug > List Variables
command in test movie mode. The Output panel uses the following conventions in displaying
TextField objects:
•
If a property is not found on the object, it is not displayed.
•
No more than four properties are displayed on a line.
•
A property with a string value is displayed on a separate line.
•
If there are any other properties defined for the object after the built-in properties are
processed, they are added to the display using the rules in the second and third points above.
•
Color properties are displayed as hexadecimal numbers (0x00FF00).
•
The properties are displayed in the following order:
,
textWidth
textHeight
,
background
,
maxhscroll
78
Chapter 3: Writing and Debugging Scripts
Object.addProperty()
[getter/setter]
function of the property.
get
,
maxChars
,
,
wordWrap
password
,
,
bottomScroll
type
.
_global
method and invoke
. The value displayed for a getter/setter property is
variable
,
,
borderColor
backgroundColor
,
multiline
selectable
,
embedFonts
restrict
_global
or
methods. A getter/
get
set
,
,
,
text
htmlText
html
,
textColor
,
,
,
scroll
hscroll
maxscroll
,
,
,
length
tabIndex
identifier.
,
,
,
border
,
.
autoSize
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?
Questions and answers