I have a very odd problem with Flash 10 and ExternalInterface. I am currently using a homemade bridge to use RTMFP with Javascript and whenever I try to pass data that contains JSON, I get a wierd Javascript error that comes from Flash :
missing ) after argument list
try { __flash__toXML(Flash.Utilities.A..."")) ; } catch (e) { "<undefined/>"; }
It's impossible to get more information since this come from Flash and it's not bound to any Javascript file.
To reproduce this problem you can use this script :
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.external.ExternalInterface;
public class Main extends Sprite
{
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
var test:String;
test = "\"\\\"\"";
ExternalInterface.call("console.log", test);
}
}
}
What can I do to avoid this problem and is it a known problem ?
__flash__toXML(Flash.Utilities.A..."")) ;
Is there more code you masked with the ... or is this what the code actually says? – Troy