I forgot an important detail and now that i tested it i kinda know why it fails.
The TabNavigator is also a custom TabNavigator, and when using it is when the bug appears, if i use the normal TabNavigator then it works. I also noticed that if i use the custom TabNavigator every property that i try to set in the custom component fails. Why is that? there is nothing weird with my custom TabNavigator, i only added code to handle an custom event i dispatch. --- In [email protected], "dmiramontesval" <[EMAIL PROTECTED]> wrote: > > I have a little issue when using custom components and localization. I > have a TabNavigator component, which has as children some custom > components which are containers: > > <mx:TabNavigator> > <custom:MyContainer/> > </mx:TabNavigator> > > > MyContainer: > > <mx:HBox> > <mx:DataGrid/> > <mx:Label/> > </mx:HBox> > > The bug appears when i want to set the label property like this: > > <mx:TabNavigator> > <custom:MyContainer id="myC" label="{resource.getString('hello')}"/> > </mx:TabNavigator> > > <mx:Script> > <![CDATA[ > import mx.resources.ResourceBundle; > > [ResourceBundle("PersonaFlex")] > private static var resource : ResourceBundle; > > ]]> > </mx:Script> > > If i test my application the label on the tab appears empty, as if i > didn't set the label property. As you can see i am using a > localization file. > The funny thing is that if i do this: > > <mx:TabNavigator> > <custom:MyContainer id="myC" label="{resource.getString('hello')}"/> > <mx:HBox label="{resource.getString('hello')}"/> > </mx:TabNavigator> > > the second tab label does appear but the first one still appears emtpy. > Furthermore, if i set the label inside my custom component instead of > doing it in the tabNavigator like this: > > <mx:TabNavigator> > <custom:MyContainer id="myC"/> > <mx:HBox label="{resource.getString('hello')}"/> > </mx:TabNavigator> > > > MyContainer: > > <mx:HBox label="{resource.getString('hello')}"> > <mx:DataGrid/> > <mx:Label/> > </mx:HBox> > > This one works, both tabs' labels appear. > > So why is this happening? Why can't i set the label property of a > custom container from the main application? Why if i set it to a > non-custom component does work? > > Thanks >
