Sorry, I should have mentioned that

func.call(Something, arg0, arg1, ...);

and

func.apply(Something, [arg0, arg1, ...]);

and

Something[functionNameAsString](arg0, arg1, ...);

are all functionally equivalent.

Scott

-----Original Message-----
From:   [EMAIL PROTECTED] on behalf of Scott Hyndman
Sent:   Thu 4/27/2006 12:07 AM
To:     Flashcoders mailing list
Cc:     
Subject:        RE: [Flashcoders] Calling a function by name stored in a 
stringvariable

var func:Function = Something[functionNameAsString];
func.call(Something, arg0, arg1, ...);
func.apply(Something, [arg0, arg1, ...]);

or

Something[functionNameAsString](arg0, arg1, ...);

Scott


-----Original Message-----
From:   [EMAIL PROTECTED] on behalf of Guillaume Maury
Sent:   Thu 4/27/2006 12:04 AM
To:     [email protected]
Cc:     
Subject:        [Flashcoders] Calling a function by name stored in a string 
variable

Hi,

I'm doing some automated testing component to test my software and I will
be using some test scenarios script in xml.

Among the different commands in those script I want to be able to write
for example
<function>processInput</function>
and have my component read the script and call the processInput() function.

How would I do this ?
Is there a way to call a function when the name of the function you want
to call is stored in a string? Something callFunction(functionName[,
parameters])

Hope somebody can answer me(I never got any answers to my question to
[EMAIL PROTECTED])...

Thanks
Guillaume Maury

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






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