Hi Sergey,
Good observation. Why do you need the header height? The documentation says, "The default value is based on the style of the title text."
So there is no fixed default header height, it depends on the Title text font size.
Having said that, the getStyle("headerHeight") should return the actual height of the header.
So for now, if you really want a number returned set the headerHeight and it will work fine.
Thanks,
-sam
On 8/12/06, Sergey Kovalyov <[EMAIL PROTECTED]> wrote:
Any ideas regarding why headerHeight style equals undefined by default
and how to get its default value? :(
On 8/11/06, Sergey Kovalyov <[EMAIL PROTECTED] > wrote:
> I found this example in help and wonder how to make it works:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Panel xmlns:mx=" http://www.adobe.com/2006/mxml"
> mouseDown="checkCollapse(event)" resizeEffect="Resize">
> <mx:Script>
> <![CDATA[
> private function checkCollapse(event:MouseEvent):void
> {
> // If the user clicks the panel header, collapse/expand the panel.
> if (event.localY < getStyle("headerHeight")) {
> currentState = currentState == "collapsed" ? "" : "collapsed";
> }
> }
> ]]>
> </mx:Script>
>
> <mx:states>
> <mx:State name="collapsed">
> <mx:SetProperty name="height" value="{getStyle('headerHeight')}"/>
> </mx:State>
> </mx:states>
> </mx:Panel>
>
> I just wrapped it into application:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
>
> <mx:Script>
> <![CDATA[
> import mx.controls.Alert;
> private function checkCollapse(event:MouseEvent):void
> {
> // If the user clicks the panel header, collapse/expand the panel.
> if (event.localY < getStyle("headerHeight")) {
> currentState = currentState == "collapsed" ? "" : "collapsed";
> }
> }
> ]]>
> </mx:Script>
>
> <mx:states>
> <mx:State name="collapsed">
> <mx:SetProperty name="height" value="{getStyle('headerHeight')}"/>
> </mx:State>
> </mx:states>
>
> <mx:Panel xmlns:mx=" http://www.adobe.com/2006/mxml"
> mouseDown="checkCollapse(event)" resizeEffect="Resize">
> <mx:TextArea />
> </mx:Panel>
>
>
> </mx:Application>
>
> You could check via debugging that (event.localY <
> getStyle("headerHeight")) is always false.
>
> On 8/11/06, Sergey Kovalyov < [EMAIL PROTECTED]> wrote:
> > Hi All!
> >
> > I want to create collapsable Panel via states. I use <mx:SetProperty>
> > to change height to myPanel.getStyle("headerHeight") value, but this
> > method return undefined. What is wrong?
> >
> > Regards, Sergey.
>
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
![]()
SPONSORED LINKS
Software development tool Software development Software development services Home design software Software development company
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
- Re: [flexcoders] Re: How to collapse Panel? Samuel Reuben
- Re: [flexcoders] Re: How to collapse Panel? Sergey Kovalyov
- Re: [flexcoders] Re: How to collapse Panel? Samuel Reuben
- Re: [flexcoders] Re: How to collapse Panel? Sergey Kovalyov
Reply via email to

