Package | com.smartfoxserver.v2.requests |
Class | public class FindUsersRequest |
Inheritance | FindUsersRequest com.smartfoxserver.v2.requests.BaseRequest |
By providing a matching expression and a search scope (a Room, a Group or the entire Zone), SmartFoxServer can find those users matching the passed criteria and return them by means of the userFindResult event.
See also
Method | Defined By | ||
---|---|---|---|
FindUsersRequest(expr:MatchExpression, target:* = null, limit:int = 0)
Creates a new FindUsersRequest instance. | FindUsersRequest |
FindUsersRequest | () | Constructor |
public function FindUsersRequest(expr:MatchExpression, target:* = null, limit:int = 0)
Creates a new FindUsersRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.
Parametersexpr:MatchExpression — A matching expression that the system will use to retrieve the users.
| |
target:* (default = null ) — The name of a Group or a single Room object where to search for matching users; if null , the search is performed in the whole Zone.
| |
limit:int (default = 0 ) — The maximum size of the list of users that will be returned by the userFindResult event. If 0 , all the found users are returned.
|
See also
29
:
private function someMethod():void { sfs.addEventListener(SFSEvent.USER_FIND_RESULT, onUserFindResult); // Create a matching expression to find users with an "age" variable greater than 29: var exp:MatchExpression = new MatchExpression("age", NumberMatch.GREATER_THAN, 29); // Find the users sfs.send(new FindUsersRequest(exp)); } private function onUserFindResult(evt:SFSEvent):void { trace("Users found: " + evt.params.users); }