Displaying and modifying variables
The Variables tab in the Debugger shows the names and values of any global and Timeline
variables in the SWF file selected in the display list. If you change the value of a variable on the
Variables tab, you can see the change reflected in the SWF file while it runs. For example, to test
collision detection in a game, you can enter the variable value to position a ball in the correct
location next to a wall.
The Locals tab in the Debugger shows the names and values of any local variables that are
available in the line of ActionScript where the SWF file is currently stopped, at a breakpoint or
anywhere else within a user-defined function.
To display a variable:
Select the movie clip containing the variable from the display list.
1.
To display global variables, select the
Click the Variables tab.
2.
The display list updates automatically as the SWF file plays. If a movie clip is removed from the
SWF file at a specific frame, that movie clip, along with its variable and variable name, is also
removed from the display list in the Debugger. However, if you mark a variable for the Watch list
(see
"Using the Watch list" on page
still be viewed in the Watch tab.
To modify a variable value:
•
Double-click the value, and enter a new value.
The value cannot be an expression. For example, you can use
www.macromedia.com"
string (any value surrounded by quotation marks [""]), a number, or a Boolean value (
).
false
Note: To write the value of an expression to the Output panel in test mode, use the
See
"Using the trace statement" on page
_global
158), the variable is removed from the Variables tab, but can
, and you cannot use
x + 2
165.
clip in the display list.
,
"Hello"
or
eval("name:" +i)
Debugging your scripts
, or
3523
"http://
. The value can be a
or
true
statement.
trace
157
Need help?
Do you have a question about the FLASH MX 2004-USING ACTIONSCRIPT IN FLASH and is the answer not in the manual?
Questions and answers