tags:

views:

263

answers:

4

in FlashBuilder 4 beta 2, I've subclassed mx.containers.Panel, adding a public method to hide the titleBar:

    public function hideTitleBar(): void {

        if (null != this.titleBar){
            this.titleBar.visible=false;
        }
    }   

I step through the code and see that the method is being invoked and that titleBar exists, and then step through the UIComponent classes and that all looks ok too: the component is initialized and $visible is being set to false. Yet the gray bar across the top of the panel remains. I want to eliminate that bar and would be grateful for some tips on how to do that.

+1  A: 

The updateDisplayList method of the Panel sets titleBar.visible to true. Subclass the Panel class, override that method, and set it to false inside that. Don't forget to call super.updateDisplayList

override protected function updateDisplayList(unscaledWidth:Number,
                                              unscaledHeight:Number):void
{
    super.updateDisplayList(unscaledWidth, unscaledHeight);
    titleBar.visible = true;
}
Amarghosh
A: 

Thanks for the answer. I notice your comment about "0% accept rate" -- but there is never an "[accept]" button on the page. I use multiple browsers and multiple PCs (at home, at work sites). Could that have something to do with it?

Tim
1) This should be a comment. 2) You should use globally defined OpenID.
LiraNuna
Yes, it should have been a Comment but the "Comment" link was not present. No Accept button either. I don't like OpenId mainly because of the security risks (see link below). Also, this site does not require registration ("You can answer and ask questions to your heart's content as an anonymous user..." from FAQ). If lack of registration prevents the helpful people from getting kudos, that is not my fault; I am grateful to those who have helped me!On OpenId Security Risks:http://www.slideshare.net/rohit11/risks-with-openid-presentation
Tim
A: 

titleBar.visible = true; does not appear to be a valid property to set....did you get this code to work?

Todd
A: 

@Todd: As I recall, no. But my recollection is hazy because I haven't been developing with AIR for several months now.

Tim