I want to be able to extend the functionality of the Message object so that I can send data relating to the particular chat message in addition to the message. To do this, I have created another variable in the Message construtor called “data”. The data type for this variable is of a new type I created called “MessageData”. Doing this I thought would allow me to pass a lot of info instead of just a single string of data. My question is how do I convert this MessageData type object into the message? I assume I need to create a data function/get/set/property?
Here is my code (my question is below):
public function set data( msgDataText:MessageData ):void
myMsgDataNode = replaceTextNode(getNode(), myMsgDataNode, “data”, msgDataText);
- The MessageData object has 2 array members called “paramNames” and “paramValues”.
- I could also change the MessageData object so it has only one member called “params” that would be an associative array of names and values. In this case I’d then like to make this data property/function generic enough so that I can use different values for paramNames and ParamValues.