You are totally right. Dur...
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()
  {
    this.running.each(function(fx) {fx.cancel();});
    this.parent();
  }

});

Reply via email to