I wonder if someone knows why this is happening. I just wasted hours in trying to figure out why two components that are inside a <TabNavigator> component get mixed up by Flex when the Application starts.
These two components have identical code , but the selectedIndex propert of the TabNavigator is set to 1 so the first component should be created first. Well Flex doesn't do that. Because the two components used identical "id" labels for their subcomponents, Flex doesn't like this and gets totally mixed up and instead of calling the Initialization() function of my first components it calls the Initialization function of the second component.
So I changed all the "id" names in the second component, and I still had a problem.
I have a viewtack also inside these two identical components, and I had to re-label the Navigator Content inside the ViewStack because otherwise Fle would still go ahed and try to initialize the second component.
This is totally weird.
Why can't I not re-use the same id's for components inside the TabNavigator components.
The id's should not be considered global, which i suspect is happening.
Anyone had troubles like this?
As per as my knowledge flex will take viestack and tabnavigator components in an array As u mention that if u will give similar id's for two components in tabnavigator or viewstack flex will going to be confused which type of array do u want to access. In flex id means the instance reference to access a perticular property.. in any languages like java u can not create similar instances id for same class.. so thats why flex will show u an error...
In a flex viewstack the first stack starts with 0 index so the best practice is to access child components through index values...
Can you post a simple example?