RSS Valid
XHTML Valid
CSS Valid

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.

2 Responses to "Background disappearing with TabNavigator in Flex"

  1. Max says:
    August 11th, 2008 at 8:39 am

  2. Todd says:
    September 13th, 2008 at 6:10 am

Leave a Reply

Availability

We'd love to hear about your project! Please see the services and contact sections for more information or for work inquiries.