Einzelnen Beitrag anzeigen
Alt 22-02-2003, 19:55   #10 (permalink)
bokel
helpQLODhelp
 
Benutzerbild von bokel
 
Registriert seit: Feb 2002
Ort: Köln
Beiträge: 8.505
Rekursiv könnte das so ausehen,
auch nicht unbedingt schöner
Ausserdem muesste man dann
strenggenommen das if auch noch
ersetzen.

ActionScript:
  1. Function.prototype.loop = function(x) {
  2.     if(x-- <= 0) return null;
  3.     //
  4.     var f = this;
  5.     return function () {
  6.         f.apply(f, arguments);
  7.         f.loop(x).apply(f, arguments);
  8.     };
  9. };
  10. a = function (x, y) {
  11.     trace(x + " " + y);
  12. };
  13. a.loop(10)("helo", "world");

mfg r.
bokel ist offline   Mit Zitat antworten