I don't know if there is a direct way to do that, somebody would confirm
it.

But I can think of another way, which is not a good if you have lots of
tabs...However, it might give you some idea. I am using TabBar with
ViewStack, instead of TabNavigator. That ways I can get the reference of
individual tabs.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>
  <mx:Style>
    .tab1 {
      fill-colors: #99cc00, #ccff66;
      selected-fill-colors: #00cc00, #66ff66;
    }
    .tab2 {
      fill-colors: #FFF04B, #FFFFCC;
      selected-fill-colors: #E9C414, #FFFFCC;
    }
    .tab3 {
      fill-colors: #8AC7D2, #CBEEF1;
      selected-fill-colors: #00A3B2, #CBEEF1;
    }
    
    
  </mx:Style>
  
  <mx:Script>
    function setTabStyles()
    {
          //this can be inside a loop to avoid hardcoing of indices.
        tb.getChildAt(0).styleName = "tab1";         
        tb.getChildAt(1).styleName = "tab2";
        tb.getChildAt(2).styleName = "tab3";
      
    }
  </mx:Script>
  <mx:TabBar id="tb" dataProvider="vs"
creationComplete="setTabStyles()">
    
  </mx:TabBar>
  <mx:ViewStack id="vs">
      <mx:Canvas label="Tab 1"/>
    <mx:Canvas label="Tab 2" />
    <mx:Canvas label="Tab 3"/>
  </mx:ViewStack>
</mx:Application>



-abdul 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Tim Blair
Sent: Tuesday, June 07, 2005 3:28 PM
To: [email protected]
Subject: [flexcoders] Styling individual tabs in a TabNavigator

Hello,

Is it possible to style the colours of individual tabs in a tab
navigator?  For example, in the following code I'm attempting create a
TabNavigator with three tabs, each of a different colour, but having no
joy...  I can style all tabs by using the Tab{} declaration, but I'm
looking for a way to style each tab seperatly.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>
  <mx:Style>
    .tab1 {
      fill-colors: #99cc00, #ccff66;
      selected-fill-colors: #00cc00, #66ff66;
    }
    .tab2 {
      fill-colors: #FFF04B, #FFFFCC;
      selected-fill-colors: #E9C414, #FFFFCC;
    }
    .tab3 {
      fill-colors: #8AC7D2, #CBEEF1;
      selected-fill-colors: #00A3B2, #CBEEF1;
    }
  </mx:Style>
  <mx:TabNavigator width="640" height="480" tabWidth="100">
    <mx:Canvas label="Tab 1" styleName="tab1" />
    <mx:Canvas label="Tab 2" styleName="tab2" />
    <mx:Canvas label="Tab 3" styleName="tab3" />
  </mx:TabNavigator>
</mx:Application>

Any suggestions/solutions?

Thanks,

Tim.

--
-------------------------------------------------------
Badpen Tech - CF and web-tech: http://tech.badpen.com/
-------------------------------------------------------
    RAWNET LTD - independent digital media agency
    "We are big, we are funny and we are clever!"
     New site launched at http://www.rawnet.com/
-------------------------------------------------------
This message may contain information which is legally
privileged and/or confidential.  If you are not the
intended recipient, you are hereby notified that any
unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such
notification notwithstanding, any comments, opinions,
information or conclusions expressed in this message
are those of the originator, not of rawnet limited,
unless otherwise explicitly and independently indicated
by an authorised representative of rawnet limited.
-------------------------------------------------------


 
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