Air LocalConnection tip

Here’s a tip that I had to resort to the Internets for today – I was trying to get a simple Flash to AIR LocalConnection system working locally but it simply wasn’t working. I hadn’t realised, that tucked away in the Help it says

To avoid specifying the domain name in the send() method, but to indicate that the receiving and sending LocalConnection objects are not in the same domain, precede the connection name with an underscore (_)

as I hadn’t realised that even though I was working locally, AIR meant it was working on a different domain. Having added an underscore:

1
conn.connect("_myConnection");
1
conn.send("_myConnection", "myFunction");

Happy days.

Tags: , , , , , ,

One Response to “Air LocalConnection tip”

  1. Tom says:

    Thanks for this! Saved me a few hours for sure.

Leave a Reply