I think Mark is looking for a way to invoke a function call with a string.
The fastest is to use bracket notation:

Assuming you have the function defined in the scope of this, you can invoke
the function like this:

this["on" + event.target.name + anotherVariable]();

I'm not sure I would use this technique/architecture myself.

On Tue, Jun 30, 2009 at 6:17 AM, Karl DeSaulniers <[email protected]>wrote:

> Are you using AS2 or AS3?
>
> I believe for as2 you would use:
>
> function onSaveFile() {
>        //"do something" code here
> }
>
> then call on the function:
> Eg:
>
> saveFile_btn.onPress = function() {
>        onSaveFile();
> };
>
> HTH
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
>
> On Jun 30, 2009, at 5:04 AM, Mark Mulhollam wrote:
>
> Hi all,
>>
>>   I want to run a function like onSaveFile()  where I create "onSaveFile"
>> from some variables ala:
>>
>> "on" + event.target.name + anotherVariable  = "onSaveFile"
>>
>> I tried Function ("on" + event.target.name + anotherVariable )( )  but
>> error
>> says Function not supported to do that.
>>
>> The string creation works but how to execute that string as a function
>> since
>> eval has been removed from Flash?
>>
>>
>> Mark
>>
>>
>> _______________________________________________
>> Flashcoders mailing list
>> [email protected]
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>
>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
-jonathan howe
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to