# The

An array containing the objects representing each buddy of the user's buddy list. The buddy list can be iterated with a for-in loop, or a specific object can be retrieved by means of the getBuddyById and getBuddyByName methods.

NOTE: this property and all the buddy-related method are available only if the buddy list feature is enabled for the current zone. Check the SmartFoxServer server-side configuration.

Each element in the buddy list is an object with the following properties:

Parameters:

  | id,: | (int) the buddy id.
  | name,: | (String) the buddy name.
  | isOnline,: | (Boolean) the buddy online status: true if the buddy is online; false if the buddy is offline.
  | isBlocked,: | (Boolean) the buddy block status: true if the buddy is blocked; false if the buddy is not blocked; when a buddy is blocked, SmartFoxServer does not deliver private messages from/to that user.
  | variables,: | (Object) an object with extra properties of the buddy (Buddy Variables); see also setBuddyVariables.

following example shows how to retrieve the properties of each buddy in the buddy list. `for (var b:String in smartFox.buddyList) { var buddy:Object = smartFox.buddyList[b]`

`// Trace buddy properties trace("Buddy id: " + buddy.id) trace("Buddy name: " + buddy.name) trace("Is buddy online? " + buddy.isOnline ? "Yes" : "No") trace("Is buddy blocked? " + buddy.isBlocked ? "Yes" : "No")`

`// Trace all Buddy Variables for (var v:String in buddy.variables) trace("\t" + v + " --> " + buddy.variables[v]) }`

See also:
  myBuddyVars

  loadBuddyList

  getBuddyById

  getBuddyByName

  removeBuddy

  setBuddyBlockStatus

  setBuddyVariables

  SFSEvent::onBuddyList

  SFSEvent::onBuddyListUpdate

SmartFoxServer Pro v1.6.0 - Buddy's isBlocked property added.

Version:
  SmartFoxServer Basic (except block status) / Pro