Reputation: 791
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"?
Upvotes: 7
Views: 3514
Reputation: 394
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");
Upvotes: 6
Reputation: 129
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!
Upvotes: 10
Reputation: 1238
In general you should avoid anything with the word "legacy" unless you have a very good reason
Good reasons include but are not limited too:
The problem with legacy systems is the company/developers have no obligation to continue maintaining it.
This specific error message means that:
"JSON compliance" or "JSON conventions" just means that any characters that are special to JSON will be escaped to prevent potential errors
Upvotes: -4