What is the “ExternalInterface” avoiding strings using JSON conventions in the new 14 player?

An error occurred when I use ExternalInterface as shown below:

A WARNING. To target Flash Player version 14 or higher content, ExternalInterface wipes out strings using JSON conventions. To maintain compatibility, content published earlier by versions of Flash Player continues to use the previous behavior.

What should I do to prevent the warning from appearing and what is the “inherited hold” that I should use instead of the “JSON convention”?

+7
flash actionscript-3
source share
3 answers

This warning appears in the debugger console when strings are sent from a running SWF to JavaScript that contain illegal characters. It can also affect whether deep binding works as expected.

Both APIs ExternalInterface and BrowserManager are executed . If only the escape () method is used to exclude a warning, try:

escape(str).replace(/\./g, "%2E").replace(/\:/g, "%3A").replace(/\//g, "%2F"); 
+6
source share

The error was caused due to missing json data. You can prevent the error by simply avoiding it:

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

Hope this helps!

+10
source share

In general, you should avoid anything with the word “legacy” unless you have a good reason.

Good reasons include, but are not limited to:

  • The effort to convert old code from an outdated system is not possible within your current business constraints.
  • An outdated system contains important features not provided by the new system.

The problem with legacy systems is that the company / developers are not required to continue to support it.

This particular error message means that:

  • If you set your target in Flash Player 14 or higher, it will use JSON-compatible escape methods.
  • If this is not compatible with your external code, you need to configure Flash Player 13 or lower.

"JSON Compliance" or "JSON Conventions" means that any characters that are special to JSON will be escaped to prevent possible errors.

-4
source share

All Articles