0 Replies Latest reply on Nov 8, 2007 3:40 AM by CRF450R

    Bug - My removePopUp Post

    CRF450R
      I posted about a problem I was having with removePopUp. I had to fire two separate events (i.e. I had to click my Cancel button twice) which calls removePopUp to actually get the pop up to go away. I did some messing around and found what appears to be a bug, at least to me:

      I was originally calling createPopUp in a MenuBar MenuEvent.ITEM_CLICK event handler. I put a createPopUp in the handler for a button click event and then had another button whose handler called removePopUp. It worked just fine. I only needed to click the Cancel button once. So, the MenuBar's MenuEvent.ITEM_CLICK handler appeared to be the problem.

      I stepped through my original code and discovered that the MenuEvent.ITEM_CLICK event was actually firing twice. So, I created a global Boolean to ensure that my createPopUp line is only called once, on the first event, and sure enough, the problem went away.

      I was wondering if two events fired, one for the "File" menu element and one for the "New Design" menu element. Not so. This line indicated that it was the same menu element:

      trace(event.item.@data.toString());

      So, the apparent bug is that a MenuBar MenuEvent.ITEM_CLICK is firing twice for the same click event. I'm new to ActionScript and Flex, but nonetheless, that appears to be a problem.