| Package | com.electrotank.electroserver4.message.request |
| Class | public class LeaveRoomRequest |
| Inheritance | LeaveRoomRequest com.electrotank.electroserver4.message.request.RequestImpl |
import com.electrotank.electroserver4.ElectroServer;
import com.electrotank.electroserver4.message.event.LeaveRoomEvent;
import com.electrotank.electroserver4.message.MessageType;
import com.electrotank.electroserver4.message.request.LeaveRoomRequest;
import com.electrotank.electroserver4.room.Room;
//
var es:ElectroServer;//assume this is created elsewhere and a connection and login occurred.
var myRoom:Room;//some room you are in
function init():void {
es.addEventListener(MessageType.LeaveRoomEvent, "onLeaveRoomEvent", this);
}
function leaveRoom():void {
var lrr:LeaveRoomRequest = new LeaveRoomRequest();
lrr.setRoomId(myRoom.getRoomId());
es.send(lrr);
}
function onLeaveRoomEvent(e:LeaveRoomEvent):void {
trace("Left room: "+e.getRoomId());
}
init();
leaveRoom();
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new instance of the LeaveRoomRequest class.
| LeaveRoomRequest | ||
|
getRoomId():Number
Returns the id of the room you want to leave.
| LeaveRoomRequest | ||
|
getZoneId():Number
Returns the id of the zone you want to leave.
| LeaveRoomRequest | ||
|
setRoomId(rId:Number):void
Sets the id of the room that you want to leave.
| LeaveRoomRequest | ||
|
setZoneId(zId:Number):void
Sets the id of the zone you want to leave.
| LeaveRoomRequest | ||
| LeaveRoomRequest | |||
| LeaveRoomRequest | () | constructor |
public function LeaveRoomRequest()Creates a new instance of the LeaveRoomRequest class.
| getRoomId | () | method |
public function getRoomId():NumberReturns the id of the room you want to leave.
ReturnsNumber — The id of the room you want to leave.
|
| getZoneId | () | method |
public function getZoneId():NumberReturns the id of the zone you want to leave.
ReturnsNumber — The id of the zone you want to leave.
|
| setRoomId | () | method |
public function setRoomId(rId:Number):voidSets the id of the room that you want to leave.
ParametersrId:Number — The id of the room you want to leave.
|
| setZoneId | () | method |
public function setZoneId(zId:Number):voidSets the id of the zone you want to leave.
ParameterszId:Number — The id of the zone you want to leave.
|
| validate | () | method |