I'm having a problem passing dynamic variables to a Javascript function using ExternalInterface
.
The variables don't seem to be resolved correctly
开发者_JAVA技巧//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?
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);
This is what I've done since I need to pass several name value pairs thru the ExternalInterface
call, and the values need to be dynamic
dynamicValue1:String='some stuff'
dynamicValue2:String='some more stuff'
ExternalInterface.call("funcName( 'firstVarName', '"+dynamicValue1+"', '2ndvarname', '"+ dynamicValue2+"' )");
精彩评论