Search code examples
actionscript-2externalinterface

passing arguments in Externalinterface.call


How would I pass these two arguments into Actionscript 2's externalinterface.call?

name: 'go'
params: {}

Why does this not work?

ExternalInterface.call("eventaction",({name: ‘go’,params: {}}));

Solution

  • Use the object literal syntax for each argument:

    ExternalInterface.call("eventaction", {"name": "go"}, {"params": {} });