tags:

views:

276

answers:

3

What's the quickest way to print "debug" messages from Flex? You know, things like "got a mouse click at ($x, $y)" or "received and event from $sender".

+1  A: 

trace(somestring)

Raul Agrait
+3  A: 
trace(mouseEvent.x + ", " + mouseEvent.y);

prints it to the console if you're using Eclipse/Flex Builder.

CookieOfFortune
Or just trace(mouseEvent.x, mouseEvent.y) works fine too.
le dorfier
+2  A: 

Using trace() is a simple way to see messages in the Flex Builder console. But you have to run in debug mode to see them. You can also get trace statements to print to a local file. For more complex logging there is a Log4J-like framework in the Flex SDK. More information on all of this is in the Flex Documentation:
http://livedocs.adobe.com/flex/3/html/help.html?content=logging_07.html

James Ward