Thanks everybody for your prompt response.

A dude on the FlashMedia List (on which we crossposted) proposed this solution:

setFunctionNames = function (pObjContainer) {
  // Description:
  // Sets the property "name" for every Function
  // that was found in "pObjContainer"
  // Arguments:
  // pObjContainer -> Obj|Mc in which to recursively
  //      search for functions
  pObjContainer = pObjContainer || _root;
  for (var p in pObjContainer) {
     if (typeof pObjContainer[p] == 'object') {
       arguments.callee(pObjContainer[p]);
     } else if (typeof pObjContainer[p] == 'function') {
       pObjContainer[p].name = p; // <-- sets the name
       arguments.callee(pObjContainer[p].prototype);
     }
  }
}

Quick, swift and efficient.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to