I have been trying to use LocalConnection, however I am getting an invalid argument error, so Im questioning whether or not this LocalConnection approach is even right:

AIR Application:

public function init() {
                var conn:LocalConnection;
                conn = new LocalConnection();
                conn.allowDomain("localhost");
                conn.connect("connection1");
                loadHTML();
}

private function loadHTML() {
                var urlReq:URLRequest = new URLRequest("http://localhost/myapp/");
                htmlUI.htmlLoader.load(urlReq);   
                visible=true;        
                //set attribute to allow external links to open in default system browser
                htmlUI.htmlLoader.navigateInSystemBrowser = true;
}

public function connect():void {
                trace("LOCAL CONNECTION SUCCEEDED");
}

FLEX Application:

private function doSomethingOnClick() : void {
    var conn:LocalConnection;
    conn = new LocalConnection();
    try {
        conn.send('app#MyAirApplication:connection1', 'connect');
    } catch (error:ArgumentError) {
        TIAlert.error(error.getStackTrace())
    }
}
0

There are 0 answers