This project is read-only.

CaseAnimation Reference

CaseAnimation Client Reference

The CaseAnimation is used as a control structure to play a specific child animation depending on the result of executing the selectScript, which should return the index of the child animation to play (this is similar to the case or select statements in C#/VB, etc.). If the provided index is outside the bounds of the child animations array (or if nothing was returned) then we will not play anything.

CaseAnimation Client Properties

Name Description
animations Array of child animations to be played (there are no assumptions placed on order because it will matter for some derived animations like , but not for others like ). To manipulate the child animations, use the functions add, clear, remove, and removeAt.
duration Length of the animation in seconds. The default is 1.
events The collection of event handlers for this behavior. This property should only be used by derived behaviors and should not be publicly called by other code.
fps Number of steps per second. The default is 25.
isActive true if animation is active, false if not.
isPlaying true if animation is playing, false if not.
percentComplete Percentage of the animation already played.
selectScript JavaScript that should evaluate to the index of the appropriate child animation to play. If this returns an index outside the bounds of the child animations array, then nothing is played.

CaseAnimation Client Methods

Name Description
add Add an animation as a child of this animation.
clear Clear the array of child animations.
dispose Dispose of the child animations
getAnimatedValue Determine the state of the animation after the given percentage of its duration has elapsed
getSelectedIndex Get the index of the animation that is selected to be played. If this returns an index outside the bounds of the child animations array, then nothing is played.
initialize Initialize the parent along with any child animations that have not yet been initialized themselves
interpolate The interpolate function is used to find the appropriate value between starting and ending values given the current percentage.
onEnd The onEnd method is called just after the animation is played each time.
onStart The onStart method is called just before the animation is played each time.
onStep The onStep method is called repeatedly to progress the animation through each frame
pause Pause the animation if it is playing. Calling play will resume where the animation left off.
play Play the animation from the beginning or where it was left off when paused.
play Create an animation, play it immediately, and dispose it when finished.
raiseEnded Raise the ended event
raisePropertyChanged Raises a change notification event.
raiseStarted Raise the started event
raiseStep Raise the step event
remove Remove the animation from the array of child animations.
removeAt Remove the animation at a given index from the array of child animations.
setOwner Make this animation the child of another animation
setValue Set the current state of the animation
stop Stop playing the animation.

CaseAnimation Client Events

Name Description
ended Adds an event handler for the ended event.
started Adds an event handler for the started event.
step Adds an event handler for the step event.

Last edited Jun 4, 2014 at 12:21 PM by prasannaranib, version 2