Page 1 of 1

get roomvariable actionscript client side

Posted: 13 Feb 2012, 13:49
by bryanadams
Hi,
i have roomvariable it name is 'Roomx' & value=55 but i cant access the variable code is below i tried 2 method but givining error

thanks


private function onRoomJoin(evt:SFSEvent):void
{
var room:Room=evt.params.room;
var extension_id :String= room.getUtfString("Roomx");
var roomVars:Array = room.getVariables();
var Roomx2:String = room.getStringValue("Roomx") as String;

Posted: 13 Feb 2012, 15:58
by A51Integrated
You have mixed up some code.

Try:

Code: Select all

private function onRoomJoin(evt:SFSEvent):void 
{ 
     var room:Room = evt.params.room; 
     var roomVar:RoomVariable = room.getVariable("Roomx");

     trace('My var is: ' + roomVar.getIntValue());
    
}

Re: get roomvariable actionscript client side

Posted: 24 Mar 2012, 14:12
by bryanadams
thanks