Hello,
I am building (what will eventually be...) an AIR app that is supposed to receive events from a SWF loaded on any domain. The tool is meant to be an external debugger so it must work between the user's local machine and any website local or not. When both files are on my local machine it works fine, but I am unable to get it to work between my local machine and other websites.
My receiving file's code looks like this:
Code:
var lc:LocalConnection = new LocalConnection();
var lc_title:String = "com.hapticdata.utils.HDDebug";
lc.connect(lc_title);
Security.allowDomain("*");
lc.allowDomain('*');
lc.client = this;
function getFeed(str:*):void {
outputArea.htmlText += str;
}
function clearFeed():void {
outputArea.htmlText="";
}
The connection part of the debugger looks like this:
Code:
//this is called to initiate tracing to the external window
public static function enterLocalConnectionMode():void {
if(turnedOn) mode = LOCALCONNECTION_MODE;
Security.allowDomain("*");
lc.allowDomain("*");
lc.addEventListener(StatusEvent.STATUS,localConnectionStatusEventHandler);
}
//this is the method that sends to the local connection, the important code is under "case LOCALCONNECTION_MODE:"
private static function submitLine(message:*):void {
switch(mode) {
case TEXTFIELD_MODE:
textField.htmlText += message + "\n";
textField.scrollV = textField.maxScrollV;
break;
case LOCALCONNECTION_MODE:
try {
if(!connected){
lc.send(lc_title,"clearFeed");
trace("clearFeed");
}
connected=true;
lc.send(lc_title,"getFeed",message);
}
catch(error:Error) {
mode = TRACE_MODE;
trace("COULD NOT FIND LOCALCONNECTION");
trace("------------------------------");
trace(message);
}
break;
case TRACE_MODE:
trace(message);
}
}
If anyone knows how to get past my domain error's I would be very grateful. Thanks!
-Kyle