Skip navigation
Currently Being Moderated

Problem with mouse or touch events

Oct 7, 2010 2:35 AM

Hello

 

I am making simple buttons with out, down, and up visible states but all too often my buttons get stuck in the roll over state. What is the best sure fire way to trigger a mouse (or touch) out event? Way back in director we used to have on MouseUpOutside. For some reason every 6th time I press on a button it is left with its roll over or down state.

 
Replies
  • Currently Being Moderated
    Oct 7, 2010 10:34 AM   in reply to 12345abcdefghi

    You might try to add a rollOut event listener in addition to your rollOver event. It does the same thing with MouseUpOutside in older versions of ActionScript.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 9, 2010 12:24 PM   in reply to 12345abcdefghi

    I have this issue as well when using simple buttons. They either get stuck on the Over state or never show the Down state.

     

    In some cases I've been able to fix the issue by triggering the action after a short delay, like this:

     

    before:

     

    var myButton:SimpleButton;

    addEventListener(MouseEvent.CLICK, onMyClick);

    function onMyClick(e:MouseEvent):void

    {

         doSomething();

    }

     

    after:

     

    var myButton:SimpleButton;

    addEventListener(MouseEvent.CLICK, onMyClick);

    function onMyClick(e:MouseEvent):void

    {

         setTimeout(doSomething, 100);

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points