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: 43
Registered: ‎11-19-2010
My Device: Blackberry Tour
My Carrier: Verizon
Accepted Solution

Dev Alpha, Air Beta: Actionbar

Has anyone here tried using the ActionBar in the beta yet?  I used the following code and it looks like the whole screen is down about 1/3 of the way and the with of the actionBar are sized way to big by defaultand going off screen.

 

package
{
    import flash.display.Sprite;
    import flash.system.Capabilities;
    
    import qnx.fuse.ui.actionbar.ActionBar;
    import qnx.fuse.ui.core.Action;
    import qnx.fuse.ui.core.Container;
    
    public class AIR_MenuTest extends Sprite{

        public static var ScreenWidth:int = Capabilities.screenResolutionX;
        public static var ScreenHeight:int = Capabilities.screenResolutionY;
        private var cont:Container = new Container();
        
        private var actionsForBar:Vector.<Action> = new Vector.<Action>;
        
        public function AIR_MenuTest(){
        
            cont.setActualSize(ScreenWidth, ScreenHeight);
            cont.setPosition(0, 0);
            trace("X: " + cont.x + ", Y: " + cont.y);

            var back:Sprite = new Sprite();
            back.graphics.beginFill(0x00A000);
            back.graphics.drawRect(0,0,cont.width, cont.height);
            back.graphics.endFill();
            addChild(cont);

            cont.background = back;
            
            var actBar:ActionBar = new ActionBar();

            actBar.setPosition(0, 0);
            actBar.width = ScreenWidth;

            actBar.showBackButton();
            
            for(var i:int = 0; i < 4; i++){
                actionsForBar.push( new Action("A" + (i+1)));
            }

            actBar.addActionsAt(actionsForBar,0);

            cont.addChild(actBar);

        }

    }
}

Maybe I am setting something up incorrectly?

Thanks in advance

 

PS: has anyone used the Crosscut menu yet either?

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

Re: Dev Alpha, Air Beta: Actionbar

You have to set the position of the action bar. It does not automatically put it at the bottom of the screen.