Re: [Flashcoders] Reach a single attribute value on a XML node withxpath AS3

2009-06-30 Thread Mark Mulhollam
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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Reach a single attribute value on a XML node withxpath AS3

2009-06-30 Thread Karl DeSaulniers

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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Reach a single attribute value on a XML node withxpath AS3

2009-06-30 Thread jonathan howe
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 k...@designdrumm.comwrote:

 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
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
-jonathan howe
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders