1 Reply Latest reply on Aug 19, 2008 4:19 PM by Newsgroup_User

    mouseOut event seems to cancel Click event

    octagonatron
      Im using a state for rollovers of a button, and a state for the click of the same button, this causes a problem when the user clicks the button. Instead of the click state being activated instead i see a brief blinking of the click state and then suddenly the app reverts to the mouseOut state, how can I tell FLEX that the click event is more important then the mouseOut event?

      EXAMPLE
      <mx:Canvas mouseOver="currentState='rollOver'" mouseOut="currentState='rollOut'" click="currentState='clicked'">

      in this example, when you click the canvas you will end up at the "rollOut" state instead of the "clicked" state but it appears the clicked state may be displayed for a brief moment as the app kind of blinks before showing the "rollOut" state. Oh and I've tried to remove the event listener on click but it doesn't appear to be fired as the event listener is not removed. HELP!?!
        • 1. Re: mouseOut event seems to cancel Click event
          Level 7

          "octagonatron" <webforumsuser@macromedia.com> wrote in message
          news:g8feue$iee$1@forums.macromedia.com...
          > Im using a state for rollovers of a button, and a state for the click of
          > the
          > same button, this causes a problem when the user clicks the button.
          > Instead of
          > the click state being activated instead i see a brief blinking of the
          > click
          > state and then suddenly the app reverts to the mouseOut state, how can I
          > tell
          > FLEX that the click event is more important then the mouseOut event?
          >
          > EXAMPLE
          > <mx:Canvas mouseOver="currentState='rollOver'"
          > mouseOut="currentState='rollOut'" click="currentState='clicked'">
          >
          > in this example, when you click the canvas you will end up at the
          > "rollOut"
          > state instead of the "clicked" state but it appears the clicked state may
          > be
          > displayed for a brief moment as the app kind of blinks before showing the
          > "rollOut" state. HELP!?!

          How bout

          mouseOut="currentState!='clicked'?currentState='mouseOut':currentState='clicked'"

          or mouseOut="mouseOutHandler()"

          private function mouseOutHandler():void{
          if (currentState!='clicked') currentState='mouseOut';
          }