views:

943

answers:

2

Hi all,

When using double click enable on any component, sometimes i have trouble activating the double click.

I realised that if I move between my fast paced single click it will NEVER fire a double click event. If however if I do not move the mouse between the clicks then the double click is fired.

Before i start using timer to get my own double click, am i the only one seeing this behaviour ?

How would you solve this ?

Sample

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()">
    <mx:Canvas id="bg" width="100%" height="100%" backgroundColor="white" />

     <mx:Script>
        <![CDATA[

            private function init():void {

            var cvstest:Canvas = new Canvas();
            cvstest.width = 200;
            cvstest.height = 200;
            cvstest.x = 100;
            cvstest.doubleClickEnabled = true;
            cvstest.addEventListener(MouseEvent.DOUBLE_CLICK, dc);
            cvstest.addEventListener(MouseEvent.MOUSE_DOWN, md);
            cvstest.setStyle("backgroundColor",0xff0000);
            this.addChild(cvstest);   



            }

         public function dc (e:MouseEvent) : void {
            trace("DOUBLE CLICK ON TEST CANVAS");
        } 
         public function md (e:MouseEvent) : void {
            trace("SINCLICK ON TEST CANVAS");
        } 

        ]]>    
    </mx:Script>
</mx:Application>
+1  A: 

On my trackpad, your code works perfectly fine, but i guess thats because it's awfully hard to move the mouse between clicks.

If I use my wacom, it seems like my double click is only successful about 1/3 of the time.

There's also this: http://bugs.adobe.com/jira/browse/FP-15 :(

quoo
I dont find it that hard, that's why i am getting the problem. I may be shaking too much
coulix
A: 

I can solve this by clearing the classInterval and calling a deferred validation plz reply if u still hav prob

ike