I can call JS functions with ExternalInterface.call('func_name',.args)
. OK
But what if I would like to call a js class instance method instead?
ExternalInterface.call('obj.method_name',.args) //this seems not to work
Is there any way of doing it?
You can call a JavaScript-Method with ExternalInterface. Be sure, you have included your JavaScript-Files or you have written your JavaScript-Function inside your index.template.html-file, this could looks like:
If you want to call the function "doSomething()" you can do this with the following code:
If you want to send some parameter and your JavaScript Function is defined like this:
You can call it with this statement:
If this is not working, check your JavaScript-Functions inside your html-file.
You have posted the following statement:
Are you sure you want to send ".args" instead of "args"?
I hope this will help you a little bit.
It was only a matter of scope. You must instantiated the swf object outside the js class. Then I can reference it in
ExternalInterface.call()
.Now from the swf I can call the
rm
methods. :)(.call('rm.method_name',...params))
Previously, I built the swf insiderm
, so there was no way to referencerm
from the swf.