//TheoAvatarSDK update 1.2.2.1 //Just replace the old code in the "roomList" movie clip, frame #1 with this one.
//The new and the updated lines are marked in red. //users list aUserList = new Array(); //set the text style roomListBox.setStyleProperty("textColor", 0x000066); roomListBox.setStyleProperty("textSize", 11); //shows the rooms list function showRoomList() { //This is called when ever a room list update comes //It completely rebuilds the room list for every update var roomlist = _root.es.getRoomList(); var list = new Array(); var aRoom = new Array(); var counter = 0; for (var i = 0; i<roomlist.length; i++) { //Reference to the room object var room = roomlist[i]; if (room.name.value!="Lobby"){ //***new if (room.name.value==_root.RoomName){_selectedRoomIndex = counter} counter++; var protected; //Indicate if the room is password protected if (room.attributes.IsPasswordProtected) { //Indicate if a room is password protected or not protected = " [locked] "; } else { protected = ""; } var label = room.name.value+protected+" ("+room.attributes.users+")"; var ob = new Object(); ob.label = label; //We actually store a reference to the room object in the element in the list component ob.data = room; aRoom.push(ob); } } roomListBox.setDataProvider(aRoom); //Alternatively, if you don't want to show the # of people in a room or show if it is locked, then // you can show the list with just 1 line of code: // roomListBox.setDataProvider(es.getRoomList()); zoneUpdated(_root.es.getZone().numUsers); } //called when the zone is updated function zoneUpdated(num) { //Display the number of people in your zone usersInZone.text = "Users in this zone: "+num; } //called when the roomList is updated function roomListUpdated(roomList,updateType,roomReference) { trace("calling roomListUpdated") showRoomList() ; //*** new //update the selection (select the right room) roomListBox.setSelectedIndex(_selectedRoomIndex); } //called when a room was clicked function roomClicked(comp) { //A room in the roomlist was clicked, so ask if the person wants to join it var room = comp.getValue(); var RoomName = room.name.value; trace("RoomName: " + RoomName) //***updated if ((_root.RoomName != RoomName) and (RoomName != undefined)){ if (roomListBox.enabled){ _root.RoomName = RoomName; eval("_root.mOffice." + _root.Me.mName).ai.CleanMouse(); eval("_root.mOffice." + _root.Me.mName).ai.ResetControlled(); _root.ResetAll(); _root.gotoAndStop("joinRoom") /* if (roomName != myRoomName) { showPopUp("Join Room", room); } */ roomListBox.enabled = false; } } } //es.userListUpdated = userListUpdated;