0

I'm having a problem passing dynamic variables to a Javascript function using ExternalInterface.

The variables don't seem to be resolved correctly

//CODE START
var customInfo :String='some custom info'

ExternalInterface.call("funcName", 'arg1Name', ' "+customInfo+" ')

//CODE END

In Javascript, I get 'customInfo' literally, it isn't being resolved.

Can anyone help?

4

2 回答 2

1
var customInfo:String = 'some custom info';

ExternalInterface.call("funcName", 'arg1Name ' + customInfo + ' ');

//or if you want to pass them as two arguments:
ExternalInterface.call("funcName", 'arg1Name', customInfo);
于 2009-11-24T16:52:48.773 回答
0

这就是我所做的,因为我需要通过ExternalInterface调用传递几个名称值对,并且值需要是动态的

dynamicValue1:String='some stuff'

dynamicValue2:String='some more stuff'

ExternalInterface.call("funcName( 'firstVarName', '"+dynamicValue1+"',  '2ndvarname', '"+ dynamicValue2+"'  )");
于 2009-11-25T16:32:22.157 回答