HELP can't get room id from json extensionresponse

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
IKA
Posts: 35
Joined: 04 Dec 2007, 12:27

HELP can't get room id from json extensionresponse

Post by IKA »

Hi,

I really can't find in the doc, how to read the room id (that i can see in the json trace) from a json command.

{"t":"xt","b":{"r":57752,"o":{"lv":"1",".............

How can i get the r param?

i have tryed by using resObj.r but it didn't work.
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

You'll need to get .data first, i.e. resObj.data.r
Smartfox's forum is my daily newspaper.
IKA
Posts: 35
Joined: 04 Dec 2007, 12:27

Post by IKA »

not working.

Are you sure about the command? Keep getting undefined also with resObj.data.r

nc.onExtensionResponse = function(resObj:Object, type:String)
{

trace(resObj.data.r);
}

keep getting undefined. Rest of the onExtensionResponse works correctly. I can read successfully the resObj._cmd and other values.

Pls help.
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

My bad, I didn't read your posting properly.

For JSON, you can't access the roomId directly (a known issue). So in order to get a room id, you'll need to manually pass it along with your data.

Another mistake:
It's resObj.dataObj - and this is for AS3. For AS2, you can access it directly.
Smartfox's forum is my daily newspaper.
IKA
Posts: 35
Joined: 04 Dec 2007, 12:27

Post by IKA »

How could this be?

the room id data is in the JSON command. How come SFS cannot intercept it?
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Smartfox's forum is my daily newspaper.
Post Reply