2009-05-18 57 views
0

当在任何组件上使用双击启用时,有时我无法激活双击。奇怪的Flex双击行为

我意识到,如果我在快节奏的单击之间移动,它永远不会触发双击事件。但是,如果我不在鼠标点击之间移动鼠标,那么双击将被触发。

我正在考虑使用计时器来获取我自己的双击。

你会如何解决这个问题?

样品

<?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

在我的触控板,你的代码工作完全正常,但我想那是因为它是非常难以移动点击的鼠标。

如果我使用我的wacom,看起来我的双击只在大约1/3的时间内成功。

还有这个:。 http://bugs.adobe.com/jira/browse/FP-15 :(

+0

我不觉得难,这就是为什么我得到这个问题我可能发抖太多了 – coulix 2009-05-19 07:34:19

0

我可以通过清除classInterval,并呼吁延期验证解决这个