Skip to content

Instantly share code, notes, and snippets.

@swannodette
Created January 15, 2009 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swannodette/47626 to your computer and use it in GitHub Desktop.
Save swannodette/47626 to your computer and use it in GitHub Desktop.
var FxChain = new Class({
name: "FxChain",
Extends: Chain,
initialize: function()
{
this.chain(arguments);
},
callChain: function()
{
if(this.cfx) this.cfx.removeEvent('onComplete', this.fnRef);
var fx = this.parent();
if(fx)
{
this.cfx = fx;
this.fnRef = this.callChain.bind(this);
fx.addEvent('onComplete', this.fnRef);
}
},
clearChain: function()
{
if(this.cfx)
{
this.cfx.removeEvent('onComplete', this.fnRef);
this.cfx.cancel();
}
this.parent();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment