Object
|
+--YAHOO.ext.Element
|
+--YAHOO.ext.Animator
Provides support for syncing animations for multiple YAHOO.ext.Actors.
This example can be seen in action here by clicking on "Click here and I will point it out".
var animator = new YAHOO.ext.Animator();
var cursor = new YAHOO.ext.Actor('cursor-img', animator);
var click = new YAHOO.ext.Actor('click-img', animator);
var resize = new YAHOO.ext.Actor('resize-img', animator);
// start capturing
animator.startCapture();
// these animations will be run in sequence
cursor.show();
cursor.moveTo(500,400);
cursor.moveTo(20, getEl('navbar').getY()+10, true, .75);
click.show();
click.alignTo(cursor, 'tl', [-4, -4]);
// Add an async function call, pass callback to argument 1
animator.addAsyncCall(Blog.navbar.undockDelegate, 1);
// pause .5 seconds
animator.pause(.5);
// again, these animations will be run in sequence
click.hide(true, .7);
cursor.alignTo('splitter', 'tr', [0, +100], true, 1);
resize.alignTo('splitter', 'tr', [-12, +100]);
// start sync block: these animations will run at the same time
animator.beginSync();
cursor.hide();
resize.show();
animator.endSync();
// play the captured animation sequences, call myCallback when done
animator.play(myCallback);
| Nested Class Summary | |
<static class> |
YAHOO.ext.Animator.AnimSequence |
<static class> |
YAHOO.ext.Animator.CompositeSequence |
| Fields inherited from class YAHOO.ext.Element |
id, defaultUnit, onVisibilityChanged, onMoved, onResized, autoBoxAdjust
|
| Constructor Summary | |
YAHOO.ext.Animator
()
|
|
| Method Summary * Parameter types in italic indicate optional parameters | |
void
|
addActor(<YAHOO.ext.Actor> actor)
Add an actor. |
void
|
addAsyncCall(<Function> fcn, <Number> callbackIndex, <Array> args, <Object> scope)
Add an async function call to the playlist. |
void
|
addCall(<Function> fcn, <Array> args, <Object> scope)
Add a function call to the playlist. |
void
|
beginSync()
Start a multi-actor sync block. |
void
|
clear()
Clear the playlist |
void
|
endSync()
End the multi-actor sync block |
Object
|
isCapturing(<YAHOO.ext.Actor> actor)
Checks whether this animator is listening to a specific actor. |
Object
|
isPlaying()
Check if this animator is currently playing |
void
|
pause(<Number> seconds)
Add a pause to the playlist (in seconds) |
void
|
play(<Function> oncomplete)
Starts playback of the playlist, also stops any capturing. |
void
|
startCapture(<Boolean> clearPlaylist)
Start capturing actions on the added actors. |
void
|
stop()
Stop at the next available stopping point |
void
|
stopCapture()
Stop capturing on all added actors. |
| Constructor Detail |
YAHOO.ext.Animator()
el - The dom element or element id
animator - (optional) The Animator that will capture this Actor's actions
selfCapture - (optional) Whether this actor should capture it's own actions to support self playback without an animator (defaults to false)
| Method Detail |
void addActor(<YAHOO.ext.Actor> actor)
actor -
void addAsyncCall(<Function> fcn, <Number> callbackIndex, <Array> args, <Object> scope)
fcn - The function to call
callbackIndex - The index of the callback parameter on the passed function. A CALLBACK IS REQUIRED.
args - The arguments to call the function with
scope - (optional) The scope of the function
void addCall(<Function> fcn, <Array> args, <Object> scope)
fcn - The function to call
args - The arguments to call the function with
scope - (optional) The scope of the function
void beginSync()
void clear()
void endSync()
Object isCapturing(<YAHOO.ext.Actor> actor)
actor -
Object isPlaying()
void pause(<Number> seconds)
seconds - The number of seconds to pause.
void play(<Function> oncomplete)
oncomplete - (optional) Callback to execute when playback has completed
void startCapture(<Boolean> clearPlaylist)
clearPlaylist - Whether to also create a new playlist
void stop()
void stopCapture()