Note that there are some explanatory texts on larger screens.

plurals
  1. POFlex: Does anybody know a TabNavigator component that allows for html labels in the tabs or how to do this?
    text
    copied!<p>I'm trying to put html-formatted labels in the tabs of a TabNavigator.</p> <p>I saw SuperTabNavigator in the FlexLib but it doesn't seem to do the trick for me.</p> <p>I found this <a href="http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&amp;productId=2&amp;postId=14186" rel="nofollow noreferrer">html button code</a> and was able to inject my own TabBar and have it change the class instantiated by the ClassFactory when a navItem is created.</p> <p>HtmlTabNavigator:</p> <pre><code>public class HtmlTabNavigator extends TabNavigator { public function HtmlTabNavigator() { super(); } override protected function createChildren():void { if (!tabBar) { tabBar = new HtmlTabBar(); // inject my class tabBar.name = "tabBar"; tabBar.focusEnabled = false; tabBar.styleName = new StyleProxy(this, tabBarStyleFilters); rawChildren.addChild(tabBar); if (FlexVersion.compatibilityVersion &lt; FlexVersion.VERSION_3_0) { tabBar.setStyle("paddingTop", 0); tabBar.setStyle("paddingBottom", 0); tabBar.setStyle("borderStyle", "none"); } } super.createChildren(); // ommits original TabBar creation but continues in inheritance chain } public function setHtmlLabels( htmlLabels:Array ):void { for (var i:uint = 0; i &lt; tabBar.numChildren; i++) { var button:Button = tabBar.getChildAt( i ) as Button; button.label = htmlLabels[ i ]; } } } </code></pre> <p>HtmlTabBar:</p> <pre><code>public class HtmlTabBar extends TabBar { public function HtmlTabBar() { super(); navItemFactory = new ClassFactory(HtmlButton); } } </code></pre> <p>Now I'm having problems with the style of the button as it looks like a regular button and not like a tab anymore. It is not apparent to me why this works when a ButtonBarButton is used.</p> <p>Any ideas are welcome.</p> <p>Thanks Stefan</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload