0 Replies Latest reply on Oct 1, 2009 6:36 AM by timo888

    Bug report: .selectedIndex on RadioButtonMenuItem = -1

    timo888 Level 1

      Flex 3.

       

      When I click on my MainMenu items, sometimes the index value = -1.  Here's the mxml definition:

       

      <mx:MenuBar id="MainMenu" x="23" y="10" width="100%" labelField="@label"   itemClick="itemClickHandler(event);"      >
              <mx:XMLList>
                  <menuitem label="Search Type">
                      <menuitem label="Standard"  type="radio" groupName="searchtypemenugroup"/>
                      <menuitem label="Proximity" type="radio" groupName="searchtypemenugroup"/>
                       <menuitem label="Phrase" type="radio" groupName="searchtypemenugroup"/>
                  </menuitem>                      
              </mx:XMLList>      
           </mx:MenuBar>

       

      And here's the eventhandler:

       

        // Event handler for the MenuBar control's itemClick event.
                 private function itemClickHandler(e:MenuEvent):void {

                // I added the call to the garbage collector thinking the intermittent nature of the problem

                    // might have something to do with memory
                      System.gc();
                      if (e.index==-1) {                 
                          var i:int;
                          i=1;
                      }
                      if ( e.index == 0) {
                      currentState="StandardState";
                        }
                      if ( (e.index==1) || (e.index==2)) {
                           currentState="ProximityState";
                      }
                  }      

       


      When I trace the program into the Adobe code where the radiobutton icon is toggled, selectedIndex in that toggle routine = -1 and the value of selectedIndex is being assigned there to index. Please see attached screenshots.

       

      Thanks

       

      P.S. I couldn't find a "proper" place to report this, so I'm reporting it here.