JavaScript's version of ActionScript's Event.ENTER_FRAME event?

前端 未结 5 1468
别那么骄傲
别那么骄傲 2021-01-03 05:42

I am trying to learn JavaScript and I am wondering whether JavaScript has a event listener just like ActionScript\'s ENTER_FRAME. Basically, I want this event listener to li

5条回答
  •  情话喂你
    2021-01-03 06:07

    I am still learning how to convert AS3 to JavaScript, but would it not be this function:

    createjs.Ticker.addEventListener("tick", gameLoop);
    

    gameLoop is the custom function that will be called on every 'tick'.

    Check out this helpful example of writing a game in Adobe Animate CC using JavaScript instead of AS3: https://software.intel.com/en-us/html5/hub/blogs/flash-cc-to-html5

提交回复
热议问题