0 Replies Latest reply on Apr 19, 2006 9:24 AM by Lacrymocéphale

    give a reference to (LoadVars||XML).sendAndLoad

    Lacrymocéphale Level 1
      I write a class to manage several HTTP echanges.
      It's a stack of url:String, method:String, datas:object and what-should-be-a-reference:object.
      Stacking function interface : public function push(url:String, method:String, datas:object, receiver:object):Void
      While unstacking, I call the sendAndLoad corresponding to the datas&receiver instanceof.
      The datas in the stack are a object copy of the original one passed to the push function and it doesn't matter.
      public function push(url:String, method:String, datas:object, receiver:object):Void {
      var entry = new Object();
      [...]
      entry.receiver = receiver; /* MUST be a reference */
      stack.push(entry);
      [...]
      }
      In both cases, XML or LoadVars, I got the problems that when I modifie the .receiver variable stocked in the stack, it doesn't affect the original one passed to the function.
      lv.sendAndLoad(currentEntry.url, currentEntry.receiver, currentEntry.method);

      Is there a way to declare that I don't want a copy of the given param but a reference ? (or to pass a reference to a function)