In Flash Action Script 3. 0 the Mouse Double Click event is disabled by default. The most commonly used event is single click. If you want to use the DOUBLE CLICK for an object, you need to enable the doubleClickEnabled value.
Action Script 3.0
var myButton:Sprite = new Sprite; // Enabling the double click for myButon myButton.doubleClickEnabled = true;
Adding Event Listener to the DOUBLE CLICK.
Action Script 3.0
var myButton:Sprite = new Sprite;
// Enabling the double click for myButon
myButton.doubleClickEnabled = true;
myButton.addEventListener(MouseEvent.DOUBLE_CLICK, onDoubleClick);
private function onDoubleClick(event:Event) :void {
trace("Double Click Detected");
}
Well!!! all these are okay for a simple movie clip/sprite. But When your movie clip having multiple children then you need to disable the mouse children. Otherwise you wont get the Double Click event from the child clips.
So the Final code Looks like this.
Action Script 3.0
var myButton:Sprite = new Sprite;
// Enabling the double click for myButon
myButton.doubleClickEnabled = true;
// Disable the mouse children of the parent clip.
myButton.mouseChildren = false;
myButton.addEventListener(MouseEvent.DOUBLE_CLICK, onDoubleClick);
private function onDoubleClick(event:Event) :void {
trace("Double Click Detected");
}





























