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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

New Developer
Posts: 55
Registered: ‎11-10-2009
My Device: Not Specified

Best way to handle re-orientation

I noticed in Burrito you can select to support auto orientation:


            // support autoOrients
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;


So in order to change from landscape to portrait, I'm guessing you would listen for an event indicating the orientation has changed.....and then do you clear the display and re-draw it? Not being able to rotate the simulator, I don't know what would happen to my display when it happens. I am not using containers, just x and y coordinates. If I used containers, would that change how I need to handle rotation of the PlayBook?

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

Re: Best way to handle re-orientation

Very good question.  The simulator does not support re-orientation yet, but listening for the change is a start.  Right now, the mode of development is based on coordinates and not on a layout manager.  In theory, if your coordinate base, you could keep two sets of coordinates based on the orientation of the device and use the Tweener to move the controls from one place to another.  A layout manager where controls are based on percentWidth and percentHeight (which is not a part of the BB framework), the layout manager would take care of most of this.  However, depending on your application.  A control that might be in one location (e.g. top right), when re-oriented, but be better to be in a different relative location (e.g. bottom right).  So layout manager might not help in those situations.  I am planning for this capability to be a little bumpy when it becomes available unless we get some support to do this easily from the SDK.

Posts: 192
Registered: ‎09-23-2009
My Device: 9860/PlayBook/Dev Alpha
My Carrier: Plus GSM

Re: Best way to handle re-orientation

I suspect that orientation change will be served, by some event in main sprite, in reaction of this we will have to relayout controls, or use setSize function on main container object.


We have to wait for SDK support here, we are talking about next summer sunny days.

Found my post helpfull? Like it! It solves your trouble? Help others and accept it as solution. Search before asking.
My apps: Secret Cod3s | Should my tablet be banned?
Jakub Nietrzeba
PGS Software S.A.
Your reliable partner in Poland - IT Outsourcing - BlackBerry, iPhone, Web and Standalone applications