Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I call anonymous function from ExternalInterface.call() method?

I need to get a javascript var in my Flash application. I like to be able to just set a variable in the javascript (client constraints) rather than define a function.

Can this be done? I am trying to use the ExternalInterface.call()

AS:

ExternalInterface.call("function(){return window.someVar}", null);

JS:

var someVar = "Test";

This does not work and I suspect it is because the ExternalInterface.call() does not like the anonymous function. Is there a way to do this?

Thanks

like image 266
Nick Avatar asked Jan 30 '26 10:01

Nick


1 Answers

oops. Forgot the ';'

It works. Thanks anyways all.

ExternalInterface.call("function(){return window.someVar;}", null)
like image 88
Nick Avatar answered Feb 01 '26 02:02

Nick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!