Thursday 19 February 2009

AS3 Double Click

The double click event introduced in AS3 (MouseEvent.DOUBLE_CLICK) will be working only if the button property "doubleClickEnabled" is set to true explicitly. If this property is not set the double click event will not be triggered.

customButton.doubleClickEnabled = true;
customButton.addEventListener(MouseEvent.DOUBLE_CLICK,onThumbClick,false ,0,true);

function onThumbClick(event:MouseEvent) {
trace(event.currentTarget);
}

8 comments:

  1. thank you! nice one!

    ReplyDelete
  2. is there a triple click?

    ReplyDelete
  3. There is no in-built functions for triple click. You might need to write a custom class and functions for triple click.

    Thanks
    Harish

    ReplyDelete
  4. wow, I was about to pull out my hair in frustration because the double click wasn't working!

    Thank you for posting this!

    ReplyDelete
  5. Can the single click event still be used at the same time?

    ReplyDelete
  6. I am Suhas

    really helpful,


    Thanks Hari.....!

    ReplyDelete
  7. thanks, you've just saved my day :)

    ReplyDelete