Hi. I'm trying to do some sort of socket connection, using VB (fscommand). My project is simple: I have 3 frames, and 2 classes.
One is called Connection, the other DataProcessor. Connection will handle connecting, sending packets, receiving them, disconnecting. DataProcessor has one function, ProcessData(sPacket) that scans the packet and determine what it is supposed to do. In the main frame, I have
var myConnect:Connection = new Connection();
I'm new to flash. All functions are public. Let's say ProcessData received a packet saying Welcome, it will send it to the Connection class, function ReceiveWelcome. I can't however manage to make them 'contact'. In the ProcessData function, I tried calling it with: ReceiveWelcome(), myConnect.ReceiveWelcome(), and Connection.ReceiveWelcome().
My function ReceiveWelcome is calling another function in the same class, and set some variables defined on top of it. ReceiveWelcome() isn't working, myConnect.ReceiveWelcome() either. Connexion.ReceiveWelcome() gives me an error saying something like 'Reference element doesn't have static attribute'. When I add the static thing, it doesn't execute my function :/...
So: How can I make two functions from different class communicate (and those functions calling other functions in the same class), or does someone has a good class documentation somewhere?
Thanks in advance.
One is called Connection, the other DataProcessor. Connection will handle connecting, sending packets, receiving them, disconnecting. DataProcessor has one function, ProcessData(sPacket) that scans the packet and determine what it is supposed to do. In the main frame, I have
var myConnect:Connection = new Connection();
I'm new to flash. All functions are public. Let's say ProcessData received a packet saying Welcome, it will send it to the Connection class, function ReceiveWelcome. I can't however manage to make them 'contact'. In the ProcessData function, I tried calling it with: ReceiveWelcome(), myConnect.ReceiveWelcome(), and Connection.ReceiveWelcome().
My function ReceiveWelcome is calling another function in the same class, and set some variables defined on top of it. ReceiveWelcome() isn't working, myConnect.ReceiveWelcome() either. Connexion.ReceiveWelcome() gives me an error saying something like 'Reference element doesn't have static attribute'. When I add the static thing, it doesn't execute my function :/...
So: How can I make two functions from different class communicate (and those functions calling other functions in the same class), or does someone has a good class documentation somewhere?
Thanks in advance.