This content has been marked as final. Show 3 replies
If UserRequest is a custom component which extends Panel, the label of the panel will be used as the label of the tab when it's added to the TabNavigator.
In order to do this you'll need to define ur as a compatible type which has a label property, i.e. as a Panel or as a UserRequest (or whatever it's called):
var ur:Panel = new UserRequest(); // UserRequest is subclass of Panel so compatible.
ur.label = "A Label"; // I can set this because I am a panel
I'm not sure I understand your last question. Do you want to know if the tab with that label already exists?
Very thanks for your help!
You're right! The last question I want to know is to find any ways to prevent the same function will be called more than 1 time. In the above case, we assume the UserRequest is a data entry form and I want to only let one copy of the form displayed every time. If user open the form that already opened, the program will show a warning or jump to the opened form directly.
Thanks you for your help again!
Can't you just check whether UserRequest is set whenever addUserRequest is called?