>Let's say i have the following:

>var stringA:String = "A";
var funct:String = "A=BA";

>how could i quickly apply funct to stringA to make stringA "BA"?

I'm thinking something like

function apply(func:String, str:String) {
var tFunction = eval("function(A){"+func+";return A}")
return tFunction(str)
}

But a quick test shows this doesn't quite work. There might be a way to get
it working; otherwise, how about some insane hack using call()?

Danny

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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