Packagecom.electrotank.electroserver5.api
Classpublic class DeleteUserVariableRequest
InheritanceDeleteUserVariableRequest Inheritance EsRequest Inheritance EsMessage Inheritance flash.events.Event

This request deletes a user variable. A user variable can also be deleted by the server. A client can only create, modify, or delete a user variable that it owns (so not one for another user). This shows how to delete a user variable and capture the resulting update event.
private var _es:ElectroServer;
private function initialize():void {
        _es.engine.addEventListener(MessageType.UserVariableUpdateEvent.name, onUserVariableUpdateEvent);
        testDeleteUserVariable();
}
private function testDeleteUserVariable():void {
        //create the request and populate it with info
        var duvr:DeleteUserVariableRequest = new DeleteUserVariableRequest();
        duvr.name = "myDescription";
        //send to the server
        _es.engine.send(duvr);
}
private function onUserVariableUpdateEvent(e:UserVariableUpdateEvent):void {
        var userVar:UserVariable;
        switch (e.updateAction) {
                case UserVariableUpdateAction.VariableCreated:
                        //the user variable is managed, so grab it
                        userVar = _es.managerHelper.userManager.me.userVariableByName(e.variable.name);
                        trace("User variable created. Name: " + userVar.name + ", value: " + userVar.value.toString());
                        break;
                case UserVariableUpdateAction.VariableDeleted:
                        //the user variable has already been deleted, so to see its name inspect the event object
                        trace("User variable deleted. Name: " + e.variable.name);
                        break;
                case UserVariableUpdateAction.VariableUpdated:
                        //the user variable is managed, so grab it
                        userVar = _es.managerHelper.userManager.me.userVariableByName(e.variable.name);
                        trace("User variable updated. Name: " + userVar.name + ", value: " + userVar.value.toString());
                        break;
        }
}
 



Public Properties
 PropertyDefined By
 InheritedmessageNumber : int
EsMessage
 InheritedmessageType : MessageType
EsMessage
  name : String
Name of the variable to delete.
DeleteUserVariableRequest
 InheritedrequestId : int
EsMessage
 InheritedserverId : String
EsMessage
Public Methods
 MethodDefined By
  
DeleteUserVariableRequest(m:MessageType = null, t:TBase = null)
DeleteUserVariableRequest
  
fromThrift(t_:TBase):void
[override]
DeleteUserVariableRequest
  
newThrift():TBase
[override]
DeleteUserVariableRequest
  
toThrift():TBase
[override]
DeleteUserVariableRequest
Property Detail
nameproperty
name:String

Name of the variable to delete.


Implementation
    public function get name():String
    public function set name(value:String):void
Constructor Detail
DeleteUserVariableRequest()Constructor
public function DeleteUserVariableRequest(m:MessageType = null, t:TBase = null)



Parameters
m:MessageType (default = null)
 
t:TBase (default = null)
Method Detail
fromThrift()method
override public function fromThrift(t_:TBase):void

Parameters

t_:TBase

newThrift()method 
override public function newThrift():TBase

Returns
TBase
toThrift()method 
override public function toThrift():TBase

Returns
TBase