Double Click event in AS2 · Dec 13, 05:53 PM

Some of us are still use AS2 here and there, and some of us want to be able to capture something like the AS3 MouseEvent.DOUBLE_CLICK. I wrote a simple decorator class called DoubleClickable to give a MovieClip the ability to broadcast doubleClick events.

The example below is hopefully pretty self explanatory :)

Sorry, but you do not have the minimum version (9) of flash player required to play this flash movie. You can install or upgrade flash here.

Just import the class and wrap your Movieclips with the the DoubleClickable class.

import com.visicswire.wrappers.DoubleClickable;

var dbc:DoubleClickable = new DoubleClickable(star); dbc.addEventListener('doubleClick', Delegate.create(this, _handleDoubleClick));

Grab the source files for a hands on example.


Jonathan Greene

comments:

  1. Thanks, this is just what I needed, is there a way to remove the double click functionality once its been applied to a movieclip?

    Clint · Aug 6, 12:08 PM · #

Name
Email
Website
Message
  Textile Help