0

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

luiz
  • 15
  • 1
  • 4

1 Answers1

1

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 S
  • 23,637
  • 2
  • 63
  • 78
  • Hello, your solution worked perfectly, thank you, saved my night ... I will study more about getOperation () and send () Thanks again – luiz Mar 02 '10 at 03:10
  • How could I pass arguments for function? explain to me more so this part? – luiz Mar 02 '10 at 03:14
  • `bridge.addNumbers(1,2,3)` => `bridge.getOperation("addNumbers").send(1,2,3)` – Chetan S Mar 02 '10 at 17:15