Class enchant.Action
Actions are units that make up the timeline. It is a unit used to specify the action you want to perform. Actions that have been added to the timeline are performed in sequential order. The transition from one action to the next occurs automatically after the number of frames specified by the time parameter have elapsed. An actionstart event is fired when the action has started. An actionend event is fired when the action has stopped. For each frame that elapses, an actiontick event is fired. You can specify a listener for these events to perform specific events when they occur.
- Defined in: enchant.js
- Extends enchant.ActionEventTarget
Constructor Attributes | Constructor Name and Description |
---|---|
enchant.Action(param)
|
Method Summary
- Methods borrowed from class enchant.EventTarget:
- addEventListener
- clearEventListener
- dispatchEvent
- on
- removeEventListener
Class Detail
enchant.Action(param)
- Parameters:
- {Object} param
- {Number} param.time Optional
- The number of frames that the action will persist. For an infinite number set this to null.
- {Function} param.onactionstart Optional
- Event listener for when the action is initiated.
- {Function} param.onactiontick Optional
- Event listener for when the action has passed one frame.
- {Function} param.onactionend Optional
- Event listener for when the action is finished.