Using ExternalInterface, you can communicate with JavaScript from Flash, but only in the window in which the Flash application is running.
It is just as simple:
ExternalInterface.call("jsFunctionName", argument, argument, ...);
To do the opposite (calling Flash from JavaScript), you do the following:
ExternalInterface.addCallback("jsFunctionName", callbackFunction);
function callbackFunction(arg:String):void {
trace(arg);
}
And then you can call jsFunctionName("foo")from JavaScript.
For more information, see adobe docs .
As for your cross-domain, you cannot, as far as I know, but you can proxy the call through your server.