2
votes

I am trying to communicate between an instance of flash embedded in a browser and a flash instance running in a C# WinForms app... I am getting a compile error that say:

1119 Access of possibly undefined property printOut through a reference with static type flash.net:LocalConnection

Here is the actionscript:

var feedback = "";

var receiving_lc:LocalConnection = new LocalConnection();

receiving_lc.connect("fromClient")

receiving_lc.printOut = function (textRecieved:String):void 

{
    feedback.text += textRecieved+"\n";
    ExternalInterface.call("ReceiveData", feedback);
};
2
Why is this tagged C# and winforms? I don't recall 1119 as a possible error code from the C# compiler, nor do I understand why the C# compiler would complain about ActionScript errors.Lasse V. Karlsen

2 Answers

4
votes

Seems like maybe you are using an ActionScript 2 example in ActionScript 3. In ActionScript 3, you can't define and assign custom functions directly to the LocalConnection object (which was the way the LocalConnection was used in AS2). Hence the compile error.

The LocalConnection.send(...) method is used to call public functions on the object defined as the client of the connection. See the example in the documentation:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/LocalConnection.html#includeExamplesSummary

2
votes

Is your "flash embedded in a browser" actually loaded from a website? If it is, then it is normal for it not work, otherwise it would be a violation of the Same Origin Policy