theDeSilva.com Andrew de Silva

MouseEvent.DOUBLE_CLICK Not Firing

March 6th, 2009 · No Comments · Flash, Flex

Recently I was working on a project that I was using MouseEvent.DOUBLE_CLICK and the darn thing wasn’t firing no matter how many times that I’ve clicked on it. After awhile I remember that most  Flex component actually have a doubleClickEnable property . Guess what was the result of the trace when I did

1
trace(image.doubleClickEnabled) // this will return false

The simple solution for getting MouseEvent.DOUBLE_CLICK to work is to ensure that you set the property of doubleClickEnable to true

1
2
image.doubleClickEnabled = true;
image.addEventListener(MouseEvent.DOUBLE_CLICK, double_click);
Share and Enjoy:
  • Digg
  • StumbleUpon
  • del.icio.us
  • Reddit
  • Technorati
  • Facebook
  • Google Bookmarks
  • LinkedIn

Tags: ·