topical media & game development

talk show tell print

mobile-graphic-easel-examples-assets-DelayedCall.js / js



  (function(window) {
  
          var DelayedCall = function (scope, handler, time, params) { this.init(scope, handler, time, params); }
          var p = DelayedCall.prototype = {};
  
          p.init = function(scope, handler, time, params) {
                  this.scope = scope;
                  this.handler = handler;
                  this.time = time;
                  this.params = params;
  
                  var _this = this;
                  setTimeout(function() { _this._handleDelay(); }, time);
          }
  
          p._handleDelay = function() {
                  this.handler.apply(this.scope, this.params);
          }
  
          window.DelayedCall = DelayedCall;
  
  })(window);


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.