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"?
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!
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");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With