• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. Managing Content and Trouble... > Tracing Variables in the Output Wind...

Tracing Variables in the Output Window

Sometimes you'll want to know the status of a variable or expression at a particular point during the playback of your movie. For example, imagine that you've created a game of Pong in which a movie clip of a ball bounces between two other movie clips of paddles. You want to find out, for testing purposes, the position of the paddle at the instant of a collision with the ball. Using the command List Variables would be very little help because of the rapidly changing variables for the paddle positions. The solution is to use the action trace. You can place the action trace at any point in the movie to have Flash send a custom message to the Output window during testing mode. The custom message is an expression you create that gives you tailored information at just the right moment. In the example of the game of Pong, you could write a trace statement that would look something like:

trace ("paddle X-position is " +
myPaddle._x);

trace ("paddle Y-position is " +
myPaddle._y);


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint