Hi,
try this:
function wrapper(obj:Object, prop:String):Void {
var f:Function = Function(obj[prop]);
obj[prop] = function() {
trace("{function: prop args: "+arguments+"}");
return f.apply(obj, arguments);
}
}
Let's say you want to "wrap" around the function Kite.fly:
wrapper(Kite, "fly");
You could easily write something that wraps every method.
On 9/28/06, Vishal Kapur <[EMAIL PROTECTED]> wrote:
I am trying to debug a third-party flash movie (so I don't have direct
access to the code, but I can ask them to add small snippets). What I
would like to be able to do is to trace the name of a function/method
and the arguments it is passed upon invocation of that function. I
need to be able to do that in a non-intrusive and generic way.
Wondering what people's thoughts are on this. I can see a couple of
potential ways this could be done: one, override some internal
function that is used to make function calls; two, use a function like
__resolve() that would get called when any defined function is
invoked. Anybody know if such things exist? Or if there is some
other, simpler way which I'm missing?
Thanks,
Vishal
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
--
Cheers,
Ray Chuan
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com