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?

2 Answers 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);
Sign up to request clarification or add additional context in comments.

Comments

0

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+"'  )");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.