When for a list control the property editable is set to true, one can click on the item and rename the label or edit the item if an item editor is set. But, I want to have a single-click select and double-click edit policy which is mostly default in other applications.
This problem is solved with a little hack using Timer class and itemEditBeginning event of List Control.
import flash.utils.Timer;-Creating a List Control with properties:
private var timer:Timer = new Timer(400,1); //time between clicks, set to 400 ms
<mx:List editable="true" itemEditBeginning="startEdit(event)" dataProvider="{listItemArray}"/>
-Defining the function startEdit
private function startEdit(evt:ListEvent):void
{
if(!timer.running){
timer.start(); // if timer is not running then start it
evt.preventDefault(); // stop editing
trace("stopped editing");
}else{
//if timer is running ie time between click is less than 400 msec
trace("allowed editing");
}
}