Flex TabNavigatior Initialization
September 15, 2008 | 3 Comments | Flex, Web Development
I sat here for quite some time banging my head against the wall trying to figure out why I was getting a null object reference error for some of my components in a TabNavigator.
After some Googling and hair pulling I found out that only the first tab is actually initialized, while the other tabs only initialized when they were selected…Go figure Adobe to leave this vital point out of the LiveDocs!
Never fear! There is a solution…
On your TabNavigator you need to set the creationPolicy property to all and then all the tabs and their children will be initialized when the application starts.
e.g. <mx:TabNavigator id=”sampleTabNavigator” creationPolicy=”all”>
Hope this saves someone else some time, and hair!
Popularity: 1% [?]