Hi Doug,

I tried to do something like this a while back. I didn't know enough about prototype based languages to get it working. Now that I know more I think you may be able to do it but you would have to find a back into the scope you were in when you called it. Here are a couple of things to keep in mind:

1. since AS2 is a prototype based language you could possibly create a new Function prototype. When the the function is created you would keep a reference to its local scope. Then in your TraceMe function you would use something like this:
function TraceMe(myVariableName) {
var strOut = myVariableName + ":" + arguments.caller.myscope["myVariableName"];
   trace(strOut);
}
You could also try creating the scope reference in the Delegate class.

2. You would also use the ASSetPropFlags to be able to see hidden variables and make unwritable functions or variables writable. 3. You may find some ways to get to the local scope in the mx.utils.Delegate class.

I don't really have time to do this obviously, which is why I'm passing this info on to you but it may be possible.

Here is the class I made that I have used for tracing things, http://www.judahfrangipane.com/?p=16. It's early work but it works.

Judah

Doug Coning wrote:
Greetings all,

Is it possible to retrieve the name of the variable passed into a
function?  For instance:

function myFunct(str:String){
        // GET ORIGINAL NAME of str?
}

var foo:String = "ABC";
var moo:String = "DEF";
myFunct(foo);
myFunct(moo);

In the above, how can myFunct know that the first call was sent 'foo'
and the second call was sent 'moo'?

Thanks,

Doug Coning Senior Web Development Programmer
FORUM Solutions, LLC
This e-mail and any attachment(s) are intended for the specified recipient(s) only and are legally protected. If you have received this communication in error, please "reply to" sender's e-mail address with notification of the error and then destroy this message in all electronic and physical forms.
_______________________________________________
[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



--
"Always bear in mind that your own resolution to succeed is more important than any 
one thing."

"You can have anything you want - if you want it badly enough. You can be anything you want to be, do anything you set out to accomplish if you hold to that desire with singleness of purpose."
- Abraham Lincoln

_______________________________________________
[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

Reply via email to