NodeFire Library

animation  1.0.6

NodeFire Library > animation > NF.anim.playerSynchronizer
Search:
 
Filters

static Class NF.anim.playerSynchronizer

Synchronize multiple player objects through a single delay timer. The menu widget utilizes the playerSynchronizer to match multiple animation effects frame for frame which smooths out the rendering.

Add new player objects at any time, including during the play of previously added players. New objects are added to the stack and included in the next rendering step.

It is not necessary to create player objects and access the synchonizer if using timeline or clip hooks with a widget. The synchonizer is primarily ment for advanced animation effects applied to document Nodes outside the widgets.

Properties

delay - int

The default delay for the synchronizer, preset value is 15.

isPlaying - boolean

True if the synchronizer is currently playing.

Methods

addPlayer

void addPlayer ( )
Adds a player object to the synchronizer. The player is automatically removed after the synchronizers play method finishes playing the object.
Returns: void

isPlayerSynchronized

boolean isPlayerSynchronized ( player )
Determines if the player object is currently added to the synchronizer.
Parameters:
player <object> A player object to search for.
Returns: boolean
True if the player is added to the synchronizer.

pause

void pause ( )
Pause the player. To resume play call the play method.
Returns: void

play

void play ( delayTimer )
Play all added player objects. This method steps through each player object and simultaneously renders each frame on a single delay timer. The synchronizers delayTimer parameter overrides the delay timers specified for individual player objects.
Parameters:
delayTimer <int> Optional, the time (in milliseconds) to delay between frames. Default value: 15
Returns: void

removePlayer

Array removePlayer ( )
Removes a player object from the synchronizer.
Returns: Array
Array of remaining players.

Events

playerFinished

playerFinished ( event )
Fires from the playerSynchronizer when one of its NF.anim.player objects finishes playing.
Parameters:
event <object> Object literal containing the following properties...
  • {type:string} The type of event.
  • {target:object} The player object which finished.


Copyright © 2012 OpenCube: Inc. All rights reserved.