This content has been marked as final. Show 13 replies
How about something like the following:
tab = Tab(tabBar.getChildAt(4));
tab.setStyle("fillColors", ["red", "white"]);
tab.setStyle("fillAlphas", [1.0, 1.0]);
Or, see the attached code for a slightly longer example.
I am getting:
1120: Access of undefined property tab.
Did you import the mx.controls.tabBarClasses.Tab class and add this code somewhere?
Yes, it is basically working. But not all the way. What I am trying to do is to have a tabset with tabs that macth colors with their ViewStacks. But it only works for a tab currently selected. All other tabs have background color changed.
If you can post your code, I'll take a look.
So you want all Tabs (selected or not) to have a background color of 0xDDE1B6?
If you want to email me directly, my email is pdehaan-at-adobe.com
Yes, I want to have a tab that matches its ViewStack's color regardless of selection.
Also, since I have already posted my code I am getting an error every time I am closing Browser (IE7):
Expected '}' Line 1, char 76.
Ah, well, if you want all tabs to be the same color (selected or not), how about just setting the Tab style rather than looping over each tab separately and applying styles. Something like this
fillColors: #DDE1B6, #DDE1B6;
fillAlphas: 1.0, 1.0;
I see. Yeah, that should work. And one more question. How would it be possible to have the selected tab and its ViewStack without a horizontal separator that comes from a canvas border? The only way I see is to have a border color matching canvas' backgroundColor. But then we have no border. It would be nice to apply a small "color patch" over that part of the border.
I changed the code up slightly to use a TabNavigator instead of a TabBar. Plus, you may need to re-tweak the width/height on some controls/containers, but hopefully this gets you a little closer.
Yes, thanks for the code. Why TabNavigator is better then TabBar?