Friday, March 27, 2009

Is double-clicking supported on various components

Question :Is double-clicking supported on various components?
Answer :Unfortunately, double-clicking is not supported by default. If you wish to add this functionality to,
say, a List or DataGrid component, you will have to add the following ActionScript 2.0 code to your
application:
var someTimestamp:Number;
public function doubleClickHandler( evt:Object ):Void {
var now = getTimer();
// we got a double-click
if( ( now - someTimestamp ) < 500 ) {
// do something here ...
}
someTimestamp = now;
}

No comments: