Created
May 23, 2012 00:58
-
-
Save rjattrill/2772621 to your computer and use it in GitHub Desktop.
Setting Tab Styles and Colours - Tab Navigator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Flex 4.6
Reference: http://stackoverflow.com/questions/300360/create-a-button-with-an-icon-in-actionscript