How would one create custom class in Flash Media Server 4 in asc code file?
I can redefine custom methods on present objects, like Client here:
Client.prototype.echo = function (complexType /*ComplexType*/) {
trace("Client.echo > calling echo");
application.broadcastMsg("echoCallback", complexType);
}
But I don't know how to define custom class.. is that even possible?
I need to know this, so I can properly relay object from client to other client and don't loose class type (see question How to relay complex type via NetConnection to FMS?)
EDIT1: I have solved my problem with relaying client-server-client complex types, but still the question stands:
If and how can I create custom class definition in Server-side ActionScript?
Yes, you can. ServerSide Actionscript is JavaScript 1.5 in fact. Just read about OOP in JavaScript.
You can define classes the following way
Then you create class instances