Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
New Developer
Posts: 60
Registered: ‎12-21-2008
My Device: Not Specified
Accepted Solution

debug statements

Hi all

 

You know how in Java and C++ you can use cin/cout, system.out.println etc for debugging statements? Is there something similar for Flash?

 

Thanks 

Developer
Posts: 409
Registered: ‎12-10-2010
My Device: PlayBook
My Carrier: N/A

Re: debug statements

[ Edited ]

 

trace("debug statement goes here");

use a + for combinations and a comma for separations:

 

var days:Array = new Array("Monday", "Thursday", "Saturday");

trace("today is " + days[1]);  //today is Thursday

trace(days[0], days[2]);  //Monday, Saturday

 

 


PlayBook Applications:
Drop Swatch
Developer
Posts: 1,269
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: debug statements

[ Edited ]

Lots of us here are new to Actionscript. Some references I've found helpful:

 

http://help.adobe.com/en_US/as3/dev/index.

 

html http://livedocs.adobe.com/flex/3/progAS_flex3.pdf

New Developer
Posts: 60
Registered: ‎12-21-2008
My Device: Not Specified

Re: debug statements

wait, what am I suppose to see here? I am using Adobe FB4, so I am expecting a console output, but still gets nothing. Here is what I did

 

trace(RightSub.getChildAt(i).name); //RightSub is a container,

Developer
Posts: 1,269
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: debug statements

[ Edited ]

You need to pass a string to trace().  Grab the text property of your container, if it contains text, and pass that to trace().   (Edit: Actually for non strings you might get something like [Object object], but it sounds like what you really want to do is get the text value out of some component.)

Developer
Posts: 1,269
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: debug statements

Also to get trace statement output to go to your console window make sure you are running a debug configuration (i.e. not a run configuration), and that the debugger is connected to the simulator:

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Re-Debug-Player-Simulator-Session...

Highlighted
New Developer
Posts: 60
Registered: ‎12-21-2008
My Device: Not Specified

Re: debug statements

ohhh, right, thanks, I just realized that the config is set on run. thanks