[Flashcoders] [SOLVED] arguments.caller -- name of this function?

2008-07-17 Thread Leonardo Scattola - New Vision srl

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


Re: [Flashcoders] [SOLVED] arguments.caller -- name of this function?

2008-07-17 Thread Hans Wichman
Hi,

and nowhere near complete:). But it might suffice for most cases.

greetz
JC



On Thu, Jul 17, 2008 at 8:24 AM, Leonardo Scattola - New Vision srl 
[EMAIL PROTECTED] wrote:

 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

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders