Client Side: Extension not parsing NUMBERS in returned objec
Posted: 29 Jan 2009, 21:31
I tried this via email (contact us), hoping the forums are faster. How do you get priority support if you purchased a license anyway?
Here's the bug I'm experiencing:
===================
I have an extension that simply sends a status variable to other users in the room with the following code:
On the client side I get the extension response, but the object that is rebuilt has UNDEFINED as the value of uID
A simple tracing of the objects values like this:
OUTPUTS:
resObj.msg = can you see this?
resObj._cmd = typs
resObj.uID = undefined
If I turn DEBUGGING ON,, I can see that the value actually gets sent by the server, but it never seems to be placed into the object. What's weird is that the STRING makes it alright, but the number doesn’t.
Here is the actual data received by the client:
[Received]: <msg t="xt"><body action="xtRes" r="-1"><dataObj><var n='uID' t='n'>3003</var><var n='_cmd' t='s'>typs</var><var n='msg' t='s'>can you see this?</var></dataObj></body></msg>
I'm stumped. Please help.
Here's the bug I'm experiencing:
===================
I have an extension that simply sends a status variable to other users in the room with the following code:
Code: Select all
var uID = user.getUserId();
var zone = _server.getCurrentZone();
var roomObj = zone.getRoom(fromRoom);
var usersInRoom = roomObj.getAllUsers();
// send to roomObj
var response = new Object();
response.msg = "can you see this?";
response.uID = uID;
trace(uID);
response._cmd = "typs"; // typing started
_server.sendResponse( response, -1, null, usersInRoom);
A simple tracing of the objects values like this:
Code: Select all
for (var i in resObj)
{
trace("resObj."+i+" = "+resObj[i]);
}resObj.msg = can you see this?
resObj._cmd = typs
resObj.uID = undefined
If I turn DEBUGGING ON,, I can see that the value actually gets sent by the server, but it never seems to be placed into the object. What's weird is that the STRING makes it alright, but the number doesn’t.
Here is the actual data received by the client:
[Received]: <msg t="xt"><body action="xtRes" r="-1"><dataObj><var n='uID' t='n'>3003</var><var n='_cmd' t='s'>typs</var><var n='msg' t='s'>can you see this?</var></dataObj></body></msg>
I'm stumped. Please help.