Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "ExternalInterface escapes strings using JSON conventions" in the new flash player 14?

There's an error when I use ExternalInterface as below:

WARNING: For content targeting Flash Player version 14 or higher, ExternalInterface escapes strings using JSON conventions. To maintain compatibility, content published to earlier Flash Player versions continues to use the legacy escaping behavior.

What should I do to prevent the warning to show up and what's "legacy escaping" that I should use instead of "JSON convention"?

like image 435
Paiboon Panusbordee Avatar asked Oct 02 '14 08:10

Paiboon Panusbordee


2 Answers

The error is caused because of json data not escaped. You can prevent the error simply by escaping it:

ExternalInterface.call(callBackFunction, escape(jsonData));

Hope this helps!

like image 101
Dave Bleeker Avatar answered Oct 27 '22 16:10

Dave Bleeker


This warning appears in the debugger console when strings are sent from a running SWF to JavaScript which contain forbidden characters. This may also affect whether deep linking works as expected.

Both the ExternalInterface and BrowserManager APIs are effected. If using the escape() method alone is not enough to eliminate the warning, try:

escape(str).replace(/\./g, "%2E").replace(/\:/g, "%3A").replace(/\//g, "%2F");
like image 35
CQ Bear Avatar answered Oct 27 '22 14:10

CQ Bear