1. <nobr id="easjo"><address id="easjo"></address></nobr>

      <track id="easjo"><source id="easjo"></source></track>
      1. 
        

      2. <bdo id="easjo"><optgroup id="easjo"></optgroup></bdo>
      3. <track id="easjo"><source id="easjo"><em id="easjo"></em></source></track><option id="easjo"><span id="easjo"><em id="easjo"></em></span></option>
          貴州做網站公司
          貴州做網站公司~專業!靠譜!
          10年網站模板開發經驗,熟悉國內外開源網站程序,包括DEDECMS,WordPress,ZBlog,Discuz! 等網站程序,可為您提供網站建設,網站克隆,仿站,網頁設計,網站制作,網站推廣優化等服務。我們專注高端營銷型網站,企業官網,集團官網,自適應網站,手機網站,網絡營銷,網站優化,網站服務器環境搭建以及托管運維等。為客戶提供一站式網站解決方案?。?!

          【easeljs】事件匯總

          來源:互聯網轉載 時間:2024-01-29 07:51:06

          文章說明:為了方便我自己查找easeljs的所有事件,所以我從easeljs的文檔里抄過來加上自己的翻譯,會慢慢補全,漏了的,錯了的,評論一下我會補上去哦。(不確定翻譯對不對的地方我會留著原文。)

          1. 繼承自,表示所有繼承自那個對象的對象都有這個事件。
          2. 定義于,表示只有這個對象才有這個事件。
          3. 加入版本,表示從這個版本起才加入這個事件,老版本沒有這個事件。
          4. “此對象”表示被添加了這個事件的對象
          5. 與jquery和js一致,事件的回調函數第一個參數會帶上事件對象,在easeljs文檔event類中可以看到各個事件屬性的說明。
          6. stage的事件全加進來了

          easeljs事件默認是不支持touch設備的,需要這樣才可以 var stage = new createjs.Stage("canvasId"); createjs.Touch.enable(stage);

          添加事件的方法

          on ( type listener [scope] [once=false] [data] [useCapture=false] ) Function

          繼承自 EventDispatcherA shortcut method for using addEventListener that makes it easier to specify an execution scope, have a listener only run once, associate arbitrary data with the listener, and remove the listener.This method works by creating an anonymous wrapper function and subscribing it with addEventListener. The wrapper function is returned for use with removeEventListener (or off).IMPORTANT: To remove a listener added with on, you must pass in the returned wrapper function as the listener, or use remove. Likewise, each time you call on a NEW wrapper function is subscribed, so multiple calls to on with the same params will create multiple listeners.Example

          var listener = myBtn.on("click", handleClick, null, false, {count:3});function handleClick(evt, data) {    data.count -= 1;    console.log(this == myBtn); // true - scope defaults to the dispatcher    if (data.count == 0) {        alert("clicked 3 times!");        myBtn.off("click", listener);        // alternately: evt.remove();    }}

          Parameters:

          type StringThe string type of the event.listener Function | ObjectAn object with a handleEvent method, or a function that will be called when the event is dispatched.[scope] Object optionalThe scope to execute the listener in. Defaults to the dispatcher/currentTarget for function listeners, and to the listener itself for object listeners (ie. using handleEvent).[once=false] Boolean optionalIf true, the listener will remove itself after the first time it is triggered.[data] optionalArbitrary data that will be included as the second parameter when the listener is called.[useCapture=false] Boolean optionalFor events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.Returns:

          Function: Returns the anonymous function that was created and assigned as the listener. This is needed to remove the listener later using .removeEventListener.

          added

          繼承自 DisplayObject當此對象被add到其它容器對象時觸發

          click

          繼承自 DisplayObject加入版本 0.6.0在用戶按下左鍵并在此對象上松開左鍵后觸發。

          dblclick

          繼承自 DisplayObject加入版本 0.6.0當用戶在此對象上雙擊左鍵后觸發。

          drawend

          定義于 stage加入版本 0.7.0每次顯示列表被繪制到canvas后并且restore過canvas context后觸發。Dispatched each update immediately after the display list is drawn to the canvas and the canvas context is restored.

          drawstart

          定義于 stage加入版本 0.7.0在清除畫布和繪制顯示列表之前觸發??梢栽谡{用event對象上使用preventDefault取消這次繪制。Dispatched each update immediately before the canvas is cleared and the display list is drawn to it. You can call preventDefault on the event object to cancel the draw.

          mousedown

          繼承自 DisplayObject加入版本 0.6.0用戶在此對象上按下左鍵后觸發。

          mouseenter

          定義于 stage加入版本 0.7.0當鼠標指針從canvas區域外(mouseInBounds == true)移進canvas區域(mouseInBounds == false)后觸發。這是目前唯一非點擊的鼠標輸入事件。

          mouseleave

          定義于 stage加入版本 0.7.0當鼠標從canvas區域內(mouseInBounds == true)移出(mouseInBounds == false)后觸發。這是目前唯一非點擊的鼠標輸入事件。(我也不知道為何這里的mouseInBounds和上面的相反,看原文吧)

          mouseout

          繼承自 DisplayObject加入版本 0.6.0當用戶鼠標從該對象的任意一個子項離開后觸發。這個事件一定要啟用enableMouseOver。另請參閱rollout。(寫好rollout后如果我還記得這里,會把這個鏈接弄好)

          mouseover

          繼承自 DisplayObject加入版本 0.6.0當用戶鼠標進入該對象的任意一個子項后觸發。這個事件一定要啟用enableMouseOver。另請參閱rollout。(寫好rollout后如果我還記得這里,會把這個鏈接弄好)

          pressmove

          繼承自 DisplayObject加入版本 0.7.0在此對象上發生了mousedown事件后,無論鼠標是否移動,pressmove事件都會持續發生在此對象上,直到松開鼠標按鈕。這事件在拖拽和類似的需求里很有用。(如果stage上加了這個事件偵聽,當stage上什么元素都沒有時,這個是無效的,需要用stagemousemove)

          pressup

          繼承自 DisplayObject加入版本 0.7.0在此對象上發生了mousedown事件后,松開鼠標會觸發。這事件在拖拽和類似的需求里很有用。

          removed

          繼承自 DisplayObject當此對象從它的父對象上移除后會觸發。

          rollout

          繼承自 DisplayObject加入版本 0.7.0這個事件和mouseout很像,但有這些不同:它不冒泡,而且它把該對象的內容認為是一個整體。例如,myContainer包含著兩個有重疊部分的子項:shapeAshapeB。用戶移動他的鼠標到shapeA上,然后直接移到shapeB上,然后離開他們倆。如果myContainerMouseout:event,會收到兩個事件,每個事件指向一個子元素:

          • 當鼠標離開shapeAtarget=shapeA
          • 當鼠標離開shapeBtarget=shapeB

          然而當事件換成rollout,只會在離開myContainer時才會觸發事件(不僅僅是離開shapeB),target=myContainer。這個事件一定要啟用enableMouseOver。(jquery也有這樣的,但是我忘記jquery中哪個是只離開父對象才觸發了。)

          rollover

          繼承自 DisplayObject加入版本 0.7.0這個事件和mouseover很像,不同之處跟rolloutmouseout的不同之處是一樣的。這個事件一定要啟用enableMouseOver。

          stagemousedown

          定義于 stage加入版本 0.6.0用戶在canvas上按下左鍵后觸發。

          stagemousemove

          定義于 stage加入版本 0.6.0當用戶在canvas上移動鼠標時持續觸發。

          stagemouseup

          定義于 stage加入版本 0.6.0當用戶在stage的某處按下左鍵,然后在頁面中能接收事件的任意一處(不同瀏覽器有些不同)松開左鍵??梢允褂?code>mouseInBounds檢查鼠標是否在stage范圍內。

          tick

          繼承自 DisplayObject: tick:642加入版本 0.6.0Dispatched on each display object on a stage whenever the stage updates. This occurs immediately before the rendering (draw) pass. When update is called, first all display objects on the stage dispatch the tick event, then all of the display objects are drawn to stage. Children will have their Tick:event event dispatched in order of their depth prior to the event being dispatched on their parent.Event Payload:

          • target ObjectThe object that dispatched the event.
          • type StringThe event type.
          • params ArrayAn array containing any arguments that were passed to the Stage.update() method. For example if you called stage.update("hello"), then the params would be ["hello"].
          • paused Boolean 指出ticker當前是否暫停
          • delta Number從上次觸發事件以來,經過了多少毫秒。
          • time NumberTicker實例化之后經過了多少毫秒
          • runTime NumberTicker實例化之后未被暫停的狀態下經過了多少毫秒。例如,你可以決定用time-runTime初始化后被暫停的總時間(The total time in ms that Ticker was not paused since it was initialized. For example, you could determine the amount of time that the Ticker has been paused since initialization with time-runTime.)

          tickend

          Defined in tickend:294Available since 0.7.0Dispatched each update immediately after the tick event is propagated through the display list. Does not fire if tickOnUpdate is false. Precedes the "drawstart" event.

          tickstart

          Defined in tickstart:287Available since 0.7.0Dispatched each update immediately before the tick event is propagated through the display list. You can call preventDefault on the event object to cancel propagating the tick event.

          標簽:easeljs-

          網絡推廣與網站優化公司(網絡優化與推廣專家)作為數字營銷領域的核心服務提供方,其價值在于通過技術手段與策略規劃幫助企業提升線上曝光度、用戶轉化率及品牌影響力。這...

          在當今數字化時代,公司網站已成為企業展示形象、傳遞信息和開展業務的重要平臺。然而,對于許多公司來說,網站建設的價格是一個關鍵考量因素。本文將圍繞“公司網站建設價...

          在當今的數字化時代,企業網站已成為企業展示形象、吸引客戶和開展業務的重要平臺。然而,對于許多中小企業來說,高昂的網站建設費用可能會成為其發展的瓶頸。幸運的是,隨...

          泰山攻略之夜爬泰山注意事項?1.泰安市區很小,起步價基本都是最熱門的景點,出行很方便?;疖嚦隹谔幱性S多出租車?;疖囌靖浇浅7泵???梢韵瘸渣c東西,嘗嘗山東煎餅和三妹湯。2.可以住泰山紅門停車場附近的客棧,提前在網上預定。出門五分鐘內就能到達山的入口。當時筆者住的客棧送了一個背包和一個石敢當的掛件,體驗很好。3.一般要三四個小時才能爬到山頂。就算你從來沒有在晚上爬過什么山,十一點出發也不晚,不會耽誤...

          魔獸世界xperl怎么用?首先,確定是否顯示化身。如果仍然是系統附帶的插件,則表示插件有問題或尚未打開。下一步,如果頭像已經更改,可以設置它。哦~xperl可以單獨使用,沒有排斥,并且可以覆蓋大部分的化身插件...

          SAP內部顧問、外部顧問、自由顧問有什么區別?1. 不同的范圍內部顧問是SAP在線公司的內部員工。與外部顧問合作,水平不高,待遇相對較差。外部顧問專門從事SAP在線實施,技術和經驗豐富,并有許多項目和商務旅行。獨立顧問,技術過硬,不屬于任何公司,獨立,項目結束后離職。2. 甲方內部顧問實施SAP系統的公司內部員工,級別有限,待遇一般。外部顧問SAP執行公司人員,乙方經驗豐富,待遇優惠。自由顧問不屬...

          TOP
          国产初高中生视频在线观看|亚洲一区中文|久久亚洲欧美国产精品|黄色网站入口免费进人
          1. <nobr id="easjo"><address id="easjo"></address></nobr>

              <track id="easjo"><source id="easjo"></source></track>
              1. 
                

              2. <bdo id="easjo"><optgroup id="easjo"></optgroup></bdo>
              3. <track id="easjo"><source id="easjo"><em id="easjo"></em></source></track><option id="easjo"><span id="easjo"><em id="easjo"></em></span></option>