Home / AJAX

ScaleAnimation Reference

RSS
Modified on 2010/05/04 23:43 by Stephen Walther Categorized as Uncategorized

ScaleAnimation Client Reference

The ScaleAnimation scales the size of the target element by the given scaleFactor (i.e. a scaleFactor of .5 will shrink it in half and a scaleFactor of 2.0 will double it). If scaleFont is true, the size of the font will also scale with the element. If center is true, then the element's center will not move as it is scaled. It is important to note that the target must be positioned (i.e. absolutely) so that setting its top/left properties will change its location in order for center to have an effect.

ScaleAnimation Client Properties

NameDescription
centerWhether the target should stay centered while scaling
durationLength of the animation in seconds. The default is 1.
eventsThe 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.
fontUnitUnit of the font, which is only used if scaleFont is true. The default value is 'pt'.
fpsNumber of steps per second. The default is 25.
id
isActivetrue if animation is active, false if not.
isInitialized
isPlayingtrue if animation is playing, false if not.
isUpdating
percentCompletePercentage of the animation already played.
scaleFactorThe amount to scale the target (a scaleFactor of .5 will shrink it in half and a scaleFactor of 2.0 will double it). The default value is 1, which does no scaling.
scaleFontWhether the font should be scaled along with the size
target
unitLength unit for the size of the target. The default value is 'px'.

ScaleAnimation Client Methods

NameDescription
beginUpdate
dispose Dispose the animation
endUpdate
getAnimatedValue Get the amount to scale the target
initialize
interpolate The interpolate function is used to find the appropriate value between starting and ending values given the current percentage.
onEnd Wipe the cached values after the animation completes
onStart Cache the initial size because it will be used to determine how much to scale the element at each step of the animation
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
raisePropertyChangedRaises a change notification event.
raiseStarted Raise the started event
raiseStep Raise the step event
setOwner Make this animation the child of another animation
setValue Scale the target by the given percentage
stop Stop playing the animation.
updated

ScaleAnimation Client Events

NameDescription
disposing
ended Adds an event handler for the ended event.
propertyChanged
started Adds an event handler for the started event.
step Adds an event handler for the step event.