六月丁香五月婷婷,丁香五月婷婷网,欧美激情网站,日本护士xxxx,禁止18岁天天操夜夜操,18岁禁止1000免费,国产福利无码一区色费

學習啦 > 學習電腦 > 電腦硬件知識 > 鍵盤鼠標 > flex鼠標雙擊事件怎么實現(xiàn)

flex鼠標雙擊事件怎么實現(xiàn)

時間: 沈迪豪908 分享

flex鼠標雙擊事件怎么實現(xiàn)

  學習前端的同學你們知道怎么你們知道什么是flex 鼠標雙擊事件嗎?不知道的話跟著學習啦小編一起來學習了解flex 鼠標雙擊事件。

  flex 鼠標雙擊事件的代碼

  <?xml version="1.0" encoding="utf-8"?>

  <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

  xmlns:s="library://ns.adobe.com/flex/spark"

  xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">

  <s:layout>

  <s:BasicLayout/>

  </s:layout>

  <fx:Script>

  <![CDATA[

  import flash.utils.getTimer;

  import mx.controls.Alert;

  private var delay:uint = 300;

  //前后兩次的單擊的時間

  private var firstClick:uint;

  private var lastClick:uint;

  protected function buttonId_mouseWheelHandler(event:MouseEvent):void

  {

  //buttonId.x = event.delta;

  if(firstClick == 0) {

  firstClick = getTimer();

  myText.text += "firstClick:"+firstClick+"\n";

  }else {

  lastClick = getTimer();

  myText.text += "lastClick:"+lastClick+"\n";

  if(lastClick-firstClick<delay) {

  myText.text += lastClick-firstClick+"\n";

  Alert.show("doubleClick");

  }

  firstClick = getTimer();

  }

  }

  ]]>

  </fx:Script>

  <fx:Declarations>

  <!-- 將非可視元素(例如服務(wù)、值對象)放在此處 -->

  </fx:Declarations>

  <!--<s:Button x="258" y="227" label="button" id="buttonId" mouseWheel="buttonId_mouseWheelHandler(event)"/>-->

  <s:TextArea id="myText" x="204" y="39"/>

  <s:Button x="258" y="227" label="button" id="buttonId" click="buttonId_mouseWheelHandler(event)"/>

  </s:Application>

鼠標雙擊事件相關(guān)文章:

1.java鼠標雙擊事件

2.怎么用JS實現(xiàn)鼠標單擊與雙擊事件共存

3.如何設(shè)置鼠標事件

4.win7鼠標怎么設(shè)置單雙擊

5.鼠標事件屬性詳解

2006633