javascript - ExternalInterface return to AS3 not working consistently in IE -


So, I'm having trouble returning a value from an external interface call, I have a piece of code that Looks like:

  var a: string = string (external interface. Call ("function () {var returnTest = 'test'; warning (return test); return returnTest;}") ); ExternalInterface.call ("Warning", A);  

The first warning (in an anonymous function on line 1) is correct (clearly). However, warning on line 2 is returning empty 90% in IE10. It works in Firefox at all times.

To understand a little bit about working 90%, it seems as if I can roll Pais again, whether it will work by adding or removing a rough meaningless alert. For example: Suppose it is not working, I can add a warning and it will start working. Or, say that it is working, I could add a warning to debugging, and it stops working, removes alerts, still does not work, adds back the alert, and it again It starts working, I know that it is not what is happening, but it behaves as if the warning is added or removed every time.

And all this happens only in IE, Firefox works at all times every time. / P>

Thank you.

EDIT: The code I provided is not the actual code that needs to be done, rather the code that I had told where the problem was. The real situation is that there is a JavaScript property in the environment which is running in our flash that we should know, but we do not have access to HTML or Javascript, in which SWF is running. The actual code should show me more like this:

  var page name frames: string = string (external interface. Call ("function () function {var pagename = server object quant page name; alerts ( Page name); return page name;} ")); ExternalInterface.call ("Warning", PageNameforms);  

Warning in the first line is just to make sure that ServerObject.currentPage.name works, which does it. The second line contains the warning debug code that was added when we found that the required page for the function.

In fact, I do not know why you are troubling things like this;)

You can make it easier:

AS3 code:

  External Interface AddClallback ("flash_function", flash_function);  

JS code: Function Flash _ function (from-js_param) {trace ('absolute:' + to_js_prem) derived from 'js') external interface. Call ("Js_function", to_js_param)

function js_function (from_flash_param) {var to_flash_param = 'I found your' + by-Flash_param; (Get_your_swf) .flash_function (to_flash_param); }

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -