Page 1 of 1
cannot access room variables
Posted: 11 Aug 2011, 14:58
by ediver
i create some users variables from the client using as3..from the admin panel i can see these variables but cannot access them from flash..
for example one var called creator and it is string
this line room.containsVariable("creator") answer false...why?
i can't access these variables outside from the ROOM_VARIABLES_UPDATE event?
Posted: 11 Aug 2011, 20:34
by rjgtav
Hi. Do you try to access these variables only after the ROOM_VARIABLES_UPDATE event? Also can you access these variables inside this event?
Posted: 11 Aug 2011, 21:23
by ediver
no nothing from these options..
but i find that i can use a variable if set it as global...
Posted: 11 Aug 2011, 21:38
by rjgtav
Well, if you're trying to get a variable from a room that isn't the one you're joined into, then yes, you need to set the variable as global, otherwise it wont be visible from players outside that room (i think they need to be at least in the same room group as that room to be able to get the variables).
Sorry, from your first post i didn't realize you were accessing those vars from an external room...
Posted: 11 Aug 2011, 21:50
by ediver
no no..i want to access the variables into the same room.. but i can't...
and i find this solution (with global variable) but i know that isn't right.. and i can't set global variable from the client ..so i want to solve this problem...
the mystery is that the variable is created because i find it to the admin panel.. i try to fire the ROOM_VARIABLES_UPDATE event and try after that..
Posted: 11 Aug 2011, 22:12
by ediver
oh my god... i find it... i use gotoAndStop(10) before call the JoinRoom Funtion and the code of using the variables was to the frame 10.. so the playhead go first to the frame and cannot find the variables and after join the room..
thanks for your reply