Hello,
Could anyone help me. Say I have an object MyObject which has
an XMLSocket defined in it, how I can access the Parent object from the onConnect function:
function MyObject()
{
this.ConnectionState = false;
this.Socket = new XMLSocket();
this.Socket.onConnect = SocketConnect;
…
}
function SocketConnect()
{
<- Here I want to set ConnectionState to true?
}
Thanks to you all. Much appreciated.
I have tried Illyas idea and it works well (though a little messy).
I would prefer Sens idea, but i cannot override the OnConnect function. This normally passes a bool as a parameter, and I just can’t get it to pass in a reference to the parent class. How would I define it?
Thanks again,
DumbMonkey.
[EDIT] Just worked it out, pretty simple really just define onConnect = SocketConnect(this);
…
function SocketConnect(Ref) {
Ref.ConnectStatus = true;
}