Try
this[a]=function()
{
trace("hi:"+arguments);
}
or more neat
var newFunc= this[a];
newFunc=function()
{
}
and later on you can access the newFunc variable
or use this[a]();
you will only have to define that function in your class constructor (if it
is a component class) or any other function that is called automatically by
mx.core.UIComponent (CreateChildren/draw ...etc).
On 2/16/06, Ryan Luce <[EMAIL PROTECTED]> wrote:
>
> Is there any way in flash to using a string to declare a function name.
> Here's an example:
> class test {
>
> var a = "hello";
> function get this[a]() {
> trace("hi");
> }
> }
>
> i've tried this[a] and taht doesn't work... i'm not sure how it would
> otherwise be done.
> Thanks,
> Ryan.
> _______________________________________________
> [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