Packagecom.smartfoxserver.v2.requests.buddylist
Classpublic class RemoveBuddyRequest
InheritanceRemoveBuddyRequest Inheritance com.smartfoxserver.v2.requests.BaseRequest

Removes a buddy from the current user's buddies list.

In order to remove a buddy, the current user must be online in the Buddy List system. If the buddy is removed successfully, the operation is confirmed by a buddyRemove event; otherwise the buddyError event is fired.

NOTE: this request can be sent if the Buddy List system was previously initialized only (see the InitBuddyListRequest request description).

View the examples

See also

buddyRemove event
buddyError event
AddBuddyRequest
InitBuddyListRequest


Public Methods
 MethodDefined By
  
RemoveBuddyRequest(buddyName:String)
Creates a new RemoveBuddyRequest instance.
RemoveBuddyRequest
Constructor Detail
RemoveBuddyRequest()Constructor
public function RemoveBuddyRequest(buddyName:String)

Creates a new RemoveBuddyRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.

Parameters
buddyName:String — The name of the buddy to be removed from the user's buddies list.

See also

Examples
The following example sends a request to remove a buddy:
     
     private function someMethod():void
     {
         sfs.addEventListener(SFSBuddyEvent.BUDDY_REMOVE, onBuddyRemoved);
         sfs.addEventListener(SFSBuddyEvent.BUDDY_ERROR, onBuddyError);
         
         // Remove Jack from my buddies list
         sfs.send(new RemoveBuddyRequest("Jack"));
     }
     
     private function onBuddyRemoved(evt:SFSBuddyEvent):void
     {
         trace("This buddy was removed:", evt.params.buddy.name);
     }
     
     private function onBuddyError(evt:SFSBuddyEvent):void
     {
         trace("The following error occurred while executing a buddy-related request:", evt.params.errorMessage);
     }