Background disappearing with TabNavigator in Flex
Sunday, August 10th, 2008
Was having an issue with the TabNavigator component in Flex today. When switching to a new Tab, the background of the whole application would turn white and parts of the Tabs were not rendering correctly. Through a little googling, I found a similar bug reported on adobe. The working around seems to work pretty nicely until the “bug” is resolved:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
/**
* Force main app to redraw
* @return void
*/
private function hackToFixBgBug():void {
this.alpha = 0.99;
this.alpha = 1.0;
}
]]>
</mx:Script>
<mx:TabNavigator id="tabNavigator" mouseDown="hackToFixBgBug()">
<!--tab windows go here-->
</mx:TabNavigator>
</mx:Application>
Basically, it looks like you’re just forcing the main swf to “redraw” whenever you click on the TabNavigator.