Hi Ram, You can Set the Sender Name as the name of the VBox and you can access that Vbox with that name, I think in your application Sender Name will be Unique for Tab Navigator.
For More Clarification See the below code, i think this will help you TabNavigator.mxml ```````````````````````````` <?xml version="1.0"?> <!-- http://blog.flexexamples.com/2007/09/26/styling-the-flex-tabnavigator-control/--> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"> <mx:Script> <![CDATA[ import mx.core.UIComponent; import mx.controls.Alert; var numChild:int=0; private function addTab():void { var currentTab:VBox = new VBox(); currentTab.label="Tab "+numChild; currentTab.name="tab"+numChild; //ADDING CHILD WIDGET TO CURRENT TAB tabNavigator.addChild(currentTab); var BtnActive:Button = new Button(); BtnActive.label="Active Tab "+numChild; BtnActive.name="BTN_tab"+numChild; BtnActive.id="tab"+numChild; BtnActive.addEventListener(MouseEvent.CLICK,activeTab); chatTabWidget.addChild(BtnActive); numChild=numChild+1; } private function activeTab(evt:MouseEvent):void { Alert.show(evt.currentTarget.id+" "+tabNavigator.getChildren().length); var tabActive:VBox= tabNavigator.getChildByName(evt.currentTarget.id) as VBox; tabActive.label="Active"; } ]]> </mx:Script> <mx:TabNavigator id="tabNavigator" width="100%" height="100%" tabHeight="40"> <mx:VBox id="chatTabWidget" label="Panel 1" backgroundColor="haloSilver"> <mx:Label text="TabNavigator container panel 1"/> <mx:Button id="BTN1" label="Add Tab" click="addTab()"/> </mx:VBox> </mx:TabNavigator> </mx:Application> On Thu, Feb 24, 2011 at 10:00 AM, Ram Poola <[email protected] > wrote: > thanx for your reply, > problem with my application is tabs are generating dynamically when the > item is selected from the grid(as shown LISTING :1)...i want to change > inactive tab name based on condition like (as shown LISTING :2) > > > ------------------------------------------------------------------------------ > LISTING > :1------------------------------------------------------------------------- > var currentTab:VBox = new VBox(); > currentTab.label=cReq.senderName; > numChild=tn.numChildren+1; > currentTab.addChild(chatTabWidget); > //ADDING CHILD WIDGET TO CURRENT TAB > > chatTabWidgets.addItem(chatTabWidget); > > tabnavigator.addChild(currentTab); > > > > datagridChatRequests.dataProvider.removeItemAt(datagridChatRequests.selectedIndex); > tabnavigator.selectedIndex=numChild-1; > childName = tabnavigator.selectedChild.label; > > > ------------------------------------------------------------------------------LISTING > 2-------------------------------------------------------------------------------------------------------- > > public function MemberInactiveMsgsCount(senderName:String):void > { > if(childName != senderName) > { > //senderName is one of the tabs in the tabnavigator > //childName is present selectedChild > > //Now i want to change senderName tab like senderName(5) > //(5) means that he had sent 5 messages > } > } > > > > ------------------------------------------------------------------------------------------------------------------------- > Please, post the solution for aboe query.. > > > On Wed, Feb 23, 2011 at 5:09 PM, kavimani shanmugam < > [email protected]> wrote: > >> see this code sample >> >> >> <?xml version="1.0"?> >> <!-- >> http://blog.flexexamples.com/2007/09/26/styling-the-flex-tabnavigator-control/--> >> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >> layout="vertical" >> verticalAlign="middle" >> backgroundColor="white"> >> >> <mx:Style> >> TabNavigator { >> backgroundColor: black; >> cornerRadius: 0; >> tabStyleName: "MyTabs"; >> firstTabStyleName: "MyFirstTab"; >> lastTabStyleName: "MyLastTab"; >> selectedTabTextStyleName: "MySelectedTab"; >> } >> >> .MyTabs { >> backgroundColor: black; >> cornerRadius: 0; >> color: black; >> } >> >> .MyFirstTab, >> .MyLastTab { >> backgroundColor: black; >> cornerRadius: 0; >> color: black; >> } >> >> .MySelectedTab { >> backgroundColor: haloBlue; >> color: haloBlue; >> textRollOverColor: haloBlue; >> } >> </mx:Style> >> <mx:Script> >> <![CDATA[ >> var Tab2Flag:Boolean=false; >> var Tab3Flag:Boolean=false; >> var Tab4Flag:Boolean=false; >> private function OnClick2():void >> { >> if(!Tab2Flag){ >> Tab2.label="Activated"; >> Tab2Flag=true; >> BTN1.label="Deactivate Tab 2"; >> } >> else >> { >> Tab2.label="Panel 2"; >> Tab2Flag=false; >> BTN1.label="Activate Tab 2"; >> } >> } >> private function OnClick3():void >> { >> if(!Tab3Flag){ >> Tab3.label="Activated"; >> Tab3Flag=true; >> BTN2.label="Deactivate Tab 3"; >> } >> else >> { >> Tab3.label="Panel 3"; >> Tab3Flag=false; >> BTN2.label="Activate Tab 3"; >> } >> } >> private function OnClick4():void >> { >> if(!Tab4Flag){ >> Tab4.label="Activated"; >> Tab4Flag=true; >> BTN3.label="Deactivate Tab 4"; >> } >> else >> { >> Tab4.label="Panel 2"; >> Tab4Flag=false; >> BTN3.label="Activate Tab 4"; >> } >> } >> ]]> >> </mx:Script> >> <mx:TabNavigator id="tabNavigator" >> width="100%" >> height="100%" >> tabHeight="40"> >> <mx:VBox id="Tab1" label="Panel 1" backgroundColor="haloSilver"> >> >> <mx:Label text="TabNavigator container panel 1"/> >> <mx:Button id="BTN1" label="Activate Tab 2" >> click="OnClick2()"/> >> <mx:Button id="BTN2" label="Activate Tab 3" >> click="OnClick3()"/> >> <mx:Button id="BTN3" label="Activate Tab 4" >> click="OnClick4()"/> >> </mx:VBox> >> <mx:VBox id="Tab2" label="Panel 2" backgroundColor="haloSilver"> >> <mx:Label text="TabNavigator container panel 2"/> >> </mx:VBox> >> <mx:VBox id="Tab3" label="Panel 3" backgroundColor="haloSilver"> >> <mx:Label text="TabNavigator container panel 3"/> >> </mx:VBox> >> <mx:VBox id="Tab4" label="Panel 4" backgroundColor="haloSilver"> >> <mx:Label text="TabNavigator container panel 4"/> >> </mx:VBox> >> </mx:TabNavigator> >> >> </mx:Application> >> >> i think this will help u >> >> >> >> On Wed, Feb 23, 2011 at 11:54 AM, mohanram < >> [email protected]> wrote: >> >>> Hi, >>> am new to flex...am doing live chat application.Here customer service >>> guy can able to chat with all the requested persons.For this, am using >>> tab navigator(for customer service guy) to chat with multiple guests >>> who are requested to chat.Now the problem is, when the guest send msg >>> (whose tab is inactive in the tab navigator),i want display the count >>> of the messages along with his name in the tab.I have been struggling >>> for 2 days to solve this.can some one please post the solution? >>> >>> >>> Thanks & Regards >>> Mohanram Poola >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Flex India Community" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/flex_india?hl=en. >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Flex India Community" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/flex_india?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Flex India Community" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/flex_india?hl=en. > -- You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.

