Code: Select all
var roomObj:Object = new Object()
roomObj.name = "The Cave"
roomObj.isGame = true
roomObj.maxUsers = 15
var variables:Array = new Array()
variables.push({name:"ogres", val:5, priv:true})
variables.push({name:"skeletons", val:4})
roomObj.vars = variables
smartFox.createRoom(roomObj)
How can i access the variables roomObj.vars.name and roomObj.vars.val
I get error while trying to access it at onJoinRoom() event. How else should i access it ?
Ps: I even tried to access it by roomObj.variables.val ... but i recieve errors . Strange thing is, while in debug mode, i can clearly see "variables" as one of the subobject.... but why i can't access it ?