Hi Alex,

Try this - I've made the tab visible and also set its width to 0, to force
subsequent tabs to move along to consume the space. tabBar is a private
property of TabNavigator, so I've had to trick the compiler into letting us
access it.


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>

        <mx:Script>
        <![CDATA[
        
                private function hideSecondTab() : Void
                {
                        var secondTab = tn["tabBar"].getChildAt( 1 );

                        secondTab.visible = false;
                        secondTab.width = 0;                            
                }
        ]]>
        </mx:Script>
        <mx:TabNavigator id="tn" width="100%" height="100%" >
                <mx:HBox label="Tab 1" width="100%" height="100%" />
                <mx:HBox label="Tab 2" width="100%" height="100%" />
                <mx:HBox label="Tab 3" width="100%" height="100%" />
        </mx:TabNavigator>
        
        <mx:Button label="Hide Second Tab" click="hideSecondTab();" />

</mx:Application> 


--
Alistair McLeod
Development Director
iteration::two
[EMAIL PROTECTED]
 
Office:  +44 (0)131 338 6108
 
This e-mail and any associated attachments transmitted with it may contain
confidential information and must not be copied, or disclosed, or used by
anyone other than the intended recipient(s). If you are not the intended
recipient(s) please destroy this e-mail, and any copies of it, immediately.
 
Please also note that while software systems have been used to try to ensure
that this e-mail has been swept for viruses, iteration::two do not accept
responsibility for any damage or loss caused in respect of any viruses
transmitted by the e-mail. Please ensure your own checks are carried out
before any attachments are opened.
 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of gevgelija50
Sent: 20 May 2005 20:16
To: [email protected]
Subject: [flexcoders] TabNavigator - Hiding Tabs

I am trying to hide certain tabs from a Tab Navigator based on some
criteria. If I follow this approach: tabnav[0].visible = false; the actual
Tab is still visible but the children within that tab are invisible. 

How can I hide the tab button itself? 

Thanks,
Alex




 
Yahoo! Groups Links



 



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to