You cannot run the second example because chain when passed multiple functions calls each function immediately in succession (no waiting for onComplete). When you call chain on the result from Fx.start, this waits for the animation to fire an onComplete. If you think about it, in the second example, there's no way for chain to know there are animations embedded inside of your functions.
David On Wed, Jan 14, 2009 at 11:44 PM, TGurske <[email protected]> wrote: > > I can do this and it works fine: > --------------------------------------------------------------------------- > fx1.start ({'background-color': "#333333"}).chain(function(){ > fx2.start ({'background-color': '#333333'}).chain(function(){ > fx3.start ({'background-color': '#333333'}) > });}); > --------------------------------------------------------------------------- > > And this will work for the first part (fx1): > --------------------------------------------------------------------------- > var animationChain = new Chain(); > animationChain.chain > ( > function(){fx1.start ({'background-color': "#333333"})}, > function(){fx2.start ({'background-color': "#333333"})}, > function(){fx3.start ({'background-color': "#333333"})} > ); > animationChain.callChain(); > --------------------------------------------------------------------------- > > But how do I get it to chain? The docs say "A Utility Class which > executes functions one after another, with each function firing after > completion of the previous." but I'll be dammed if I can figure out > how to do it. And in case you're asking: The reason I want to use the > new chain function is so I can use "clearChain()" while the chain is > running. I need to be able to stop (interrupt) a chain instead of > having to wait for it to finish. > > Thanks for your help in advance!!! > >
