FLASH CS3
User Guide
408
A list of all the objects currently on the Stage appears in the Output panel. The list does not update automatically as
the SWF file plays; you must select the List Objects command each time you want to send the information to the
Output panel.
List a SWF file’s variables in the Output panel
In the test environment, the List Variables command shows a list of all the variables in the SWF file. Global variables
(those declared with the
_global
identifier) appear at the top of the List Variables output in a Global Variables
section, and each variable has a
_global
prefix.
In addition, the List Variables command shows getter/setter properties—properties that are created with the
Object.addProperty()
method and start
get
or
set
methods. In the Output panel, the value of a getter/setter
property is prefixed with
[getter/setter]
. The software determines the value that appears for a getter/setter
property by evaluating the
get
function.
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.
1
Create a new FLA document. For example, you might call it
listvariables.fla
.
2
Add the following ActionScript 2.0 in the Actions panel:
_global.myName = "Buster";
var myCatSays:String = "meow";
var myNum:Number = 313;
var myArray:Array = ["one", "two", "three"];
3
Select Control > Test Movie.
4
Select Debug
> List Variables in the test environment.
A list of all the variables currently in the SWF file appears in the Output panel. The following example shows the
variables that would be output from the code listed above in step 2:
Global Variables:
Variable _global.myName = "Buster"
Level #0:
Variable _level0.$version = "WIN 9,0,29,3"
Variable _level0.myCatSays = "meow"
Variable _level0.myNum = 313
Variable _level0.myArray = [object #1, class 'Array'] [0:"one",
1:"two",
2:"three"
]
Debugging text field objects
To obtain debugging information about TextField objects, you can use the Debug
> List Variables command or the
Debug
> List Objects command in the test environment. When you use Debug
> List Variables, the Output panel
uses the following conventions to show TextField properties:
•
No more than four properties appear on a line.
•
A property with a string value appears on a separate line.
•
Color properties appear as hexadecimal numbers (0x00FF00).