| Package | com.smartfoxserver.v2.requests.buddylist |
| Class | public class RemoveBuddyRequest |
| Inheritance | RemoveBuddyRequest com.smartfoxserver.v2.requests.BaseRequest |
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).
See also
| Method | Defined By | ||
|---|---|---|---|
RemoveBuddyRequest(buddyName:String)
Creates a new RemoveBuddyRequest instance. | RemoveBuddyRequest | ||
| 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.
ParametersbuddyName:String — The name of the buddy to be removed from the user's buddies list.
|
See also
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);
}