1 ; i--) { channelViewStack.removeChildAt(i-1); } } /* START OF Menubar */ [Bindable] public var menuBarCollection:XMLListCollection; private var menubarXML:XMLList = <> ; // Event handler to initialize the MenuBar control. private function initCollections():void { menuBarCollection = new XMLListCollection(menubarXML); } // Event handler for the MenuBar control's itemClick event. private function menuHandler(event:MenuEvent):void { if (event.item.@data == "connect") { connectWindow = new ConnectWindow(); connectWindow.flexIrcClient = this.flexIrcClient; PopUpManager.addPopUp(connectWindow,this, true); } else if (event.item.@data == "disconnect") { this.flexIrcClient.disconnect(); } else if (event.item.@data == "join") { joinChannelDialog = new JoinChannelDialog(); joinChannelDialog.flexIrcClient = this.flexIrcClient; PopUpManager.addPopUp(joinChannelDialog,this, true); } else if (event.item.@data == "pm") { privateMessageDialog = new PrivateMessageDialog(); privateMessageDialog.flexIrcClient = this.flexIrcClient; PopUpManager.addPopUp(privateMessageDialog,this, true); } } /* END OF Menubar */ ]]>