Package | com.smartfoxserver.v2.requests |
Class | public class ChangeRoomNameRequest |
Inheritance | ChangeRoomNameRequest com.smartfoxserver.v2.requests.BaseRequest |
If the renaming operation is successful, the roomNameChange event is dispatched to all the users who subscribed the Group to which the target Room belongs, including the user who renamed it. If the user is not the creator (owner) of the Room, or if the Room was configured so that renaming is not allowed (see the RoomSettings.permissions parameter), the roomNameChangeError event is fired. An administrator or moderator can override the first constrain (he is not requested to be the Room's owner).
If the user is not the creator (owner) of the Room, or if the new name doesn't match the related criteria in Zone configuration, the roomNameChangeError event is fired. An administrator or moderator can override this constrain (he is not requested to be the Room's owner).
If the Room was configured so that renaming is not allowed (see the RoomSettings.permissions parameter), the request is ignored and no error is fired.
See also
Method | Defined By | ||
---|---|---|---|
ChangeRoomNameRequest(room:Room, newName:String)
Creates a new ChangeRoomNameRequest instance. | ChangeRoomNameRequest |
ChangeRoomNameRequest | () | Constructor |
public function ChangeRoomNameRequest(room:Room, newName:String)
Creates a new ChangeRoomNameRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.
Parametersroom:Room — The Room object corresponding to the Room whose name should be changed.
| |
newName:String — The new name to be assigned to the Room.
|
See also
private function someMethod():void { sfs.addEventListener(SFSEvent.ROOM_NAME_CHANGE, onRoomNameChanged); sfs.addEventListener(SFSEvent.ROOM_NAME_CHANGE_ERROR, onRoomNameChangeError); var theRoom:Room = sfs.getRoomByName("Gonzo's Room"); sfs.send(new ChangeRoomNameRequest(theRoom, "Gonzo The Great's Room")); } private function onRoomNameChanged(evt:SFSEvent):void { trace("Room " + evt.params.oldName + " was successfully renamed to " + evt.params.room.name); } private function onRoomNameChangeError(evt:SFSEvent):void { trace("Room name change failed: " + evt.params.errorMessage); }