views:

29

answers:

1

Hello people, I have the following code in actionscript 3:

var async:AsyncToken;

async = bridge.retornamenu();

The bridge is a remote object, instantiated. The retornamenu() is the function that I want the remote object open in amfphp.

However the retornamenu() is a dynamic function, which turns another function, but I can not run it at runtime,

example

var stringfunction:String = "retornamenu()" // this name is dynamic.

var async:AsyncToken;

async = bridge.stringfunction;

But this way does not work, not perform the function retornamenu();

someone could help me? I am a few days behind the solution, my project stopped,

Thanks in advance

+1  A: 

Use getOperation() and send() it.

var stringfunction:String = "retornamenu" // this name is dynamic.    
var async:AsyncToken;
async = bridge.getOperation(stringfunction).send();

If there are arguments to the function, you can pass it through send(args)

Chetan Sastry
Hello, your solution worked perfectly, thank you, saved my night ...I will study more about getOperation () and send ()Thanks again
luiz
How could I pass arguments for function? explain to me more so this part?
luiz
`bridge.addNumbers(1,2,3)` => `bridge.getOperation("addNumbers").send(1,2,3)`
Chetan Sastry