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
Developer
Posts: 21
Registered: ‎10-17-2009
My Device: Not Specified

Different behaviour between debug as, run as and release versions

Hi,

 

I am porting a flex game to the playbook and I just hit a wall: whether I run the game as 'debug as', 'run as' or from the exported version, I see different behaviour! This is using Flex Builder 4.5.1 and a real device.

 

In 'Debug as' the game runs perfectly normal: I can load a level and play it. It behaves as expected.

 

In 'Run as' the game loads as normal, but at a very specific point in the level (it is always at the same place), the ball (it is a pinball game) dissapears. This never-ever should happen. But the kicker is that the game doesn't crash, I can still access the menu.

 

Using the exported and signed version, the game will not load a level. It just stop responding instead.

 

I am at a loss here. This is my first flash game for the Playbook. What is the possible cause for such strangeness? Is there a log I can access that will give more information?

 

Thanks for the help.

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Different behaviour between debug as, run as and release versions

There might be some exception being thrown that you are not seeing. The good news is that it occurs in the same place. I would trace/log more information in that part of the code. Some boundary condition is not being met. If you are using floating point math to determine calculations, look at using integer math or make certain your rounding properly or allowing for some epsilon difference in your math (e.g. (now-before) < 0.10).
Highlighted
Developer
Posts: 21
Registered: ‎10-17-2009
My Device: Not Specified

Re: Different behaviour between debug as, run as and release versions

Thanks for the suggestion, I will do that. However, why would it be different between the different 'versions' of the code? How can I trust that what I debug in debug mode will not run differently in release after that?

 

Alain-Daniel

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Different behaviour between debug as, run as and release versions

I'm certain there are some people on this forum that can talk about compiler options and optimization and I am not certain if that even applies to AS3 compilation. I just know that dealing with floating point math and "nearnest" to other things you have to take into account precision of the math and the frame rate that is is going. Maybe at frame "t" your not near but in frame "t+1", you overshot it too far that your not "near" but "pass" your tolerance and it is not being caught. Maybe released code frame rate is more accurate, I am not certain. Hopefully a trace/log of the values will shead light onto the problem.