true
735
Description
Statement; evaluates the expression and displays the result in the Output panel in test mode.
Use this action to record programming notes or to display messages in the Output panel while
testing a movie. Use the
expression
parameter to check if a condition exists, or to display values
in the Output panel. The
trace()
action is similar to the
alert
function in JavaScript.
You can use the Omit Trace Actions command in Publish Settings to remove
trace()
actions
from the exported SWF file.
Example
This example is from a game in which a draggable movie clip instance named
my_mc
must be
released on a specific target. A conditional statement evaluates the
_droptarget
property and
executes different actions depending on where
my_mc
is released. The
trace()
action is used at
the end of the script to evaluate the location of the
my_mc
movie clip and to display the result in
the Output panel. If
my_mc
doesn’t behave as expected (for example, if it snaps to the wrong
target), the values sent to the Output panel by the
trace()
action will help you determine the
problem in the script.
on(press) {
my_mc.startDrag();
}
on(release) {
if(eval(_droptarget) != target) {
my_mc._x = my_mc_xValue;
my_mc._y = my_mc_yValue;
} else {
var my_mc_xValue = my_mc._x;
var my_mc_yValue = my_mc._y;
target = "_root.pasture";
}
trace("my_mc_xValue = " + my_mc_xValue);
trace("my_mc_xValue = " + my_mc_xValue);
stopDrag();
}
true
Availability
Flash Player 5.
Usage
true
Description
Constant; a unique Boolean value that represents the opposite of
false
.
See also
false
Содержание FLASH MX 2004 - ACTIONSCRIPT
Страница 1: ...ActionScript Reference Guide...
Страница 8: ...8 Contents...
Страница 12: ......
Страница 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Страница 54: ...54 Chapter 2 ActionScript Basics...
Страница 80: ...80 Chapter 3 Writing and Debugging Scripts...
Страница 82: ......
Страница 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Страница 112: ......
Страница 120: ...120 Chapter 6 Using the Built In Classes...
Страница 176: ......
Страница 192: ...192 Chapter 10 Working with External Data...
Страница 202: ...202 Chapter 11 Working with External Media...
Страница 204: ......
Страница 782: ...782 Chapter 12 ActionScript Dictionary...
Страница 793: ...Other keys 793 221 222 Key Key code...
Страница 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Страница 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Страница 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Страница 816: ...816 Index...