Skip to content

Instantly share code, notes, and snippets.

@rjattrill
Created May 23, 2012 00:58
Show Gist options
  • Save rjattrill/2772621 to your computer and use it in GitHub Desktop.
Save rjattrill/2772621 to your computer and use it in GitHub Desktop.
Setting Tab Styles and Colours - Tab Navigator
<fx:Script>
<![CDATA[
import mx.controls.Button;
[Embed(source='/assets/small_tick.png')]
[Bindable]
public var imgTick:Class;
private function setTabColours(index:int):void {
(tnMain.getTabAt(index) as mx.controls.Button).enabled = false; // Tab appears disabled
(tnMain.getTabAt(index) as mx.controls.Button).setStyle("color", color); // Font colour
(tnMain.getTabAt(index) as mx.controls.Button).setStyle("chromeColor","#7AB1C3"); // Tab colour
(tnMain.getTabAt(index) as mx.controls.Button).setStyle("icon", imgTick); // Icon
]]>
</fx:Script>
<mx:TabNavigator id="tnMain" width="100%" height="100%">
<s:NavigatorContent label="Tab1" width="100%" height="100%">
</s:NavigatorContent>
<s:NavigatorContent label="Tab2" width="100%" height="100%">
</s:NavigatorContent>
</mx:TabNavigator>
@rjattrill
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment