1 Reply Latest reply on Jul 25, 2006 5:23 AM by diegovolpe

    Alert, PopupManager and MenuBar conflicts

    diegovolpe

      After calling "Alert.show()" from itemClick handler of menuBar, Popups stop working.
      When using "Alert.show()" outside the itemClick handler the problem doesn't happen, ex: Button click handler.
      I tried to set the parent of Alert and Popup, but the problem keep happening.
      Any Ideas?



      My mxml file:
      ...
      <mx:MenuBar id="mainMenu" labelField="@label" width="100%" dataProvider="{xmlData.children()}" itemClick="menuClick(event)"/>
      <mx:Button click="Alert.show('I was clicked...')" label="click me"/>
      ...


      My .AS file:
      ...
      internal function menuClick(e:MenuEvent){
      var action:String = e.item.@action;
      switch(action){
      case 'logoff':
      logoff();
      break;

      default:
      Alert.show("Something else");
      break;
      }
      }

      public function logoff(){
      ins_loginWindow = new loginWindow();
      ins_loginWindow.addEventListener("logged",login);
      PopUpManager.addPopUp(ins_loginWindow,this,true,PopUpManagerChildList.APPLICATION);
      }
      ...