A simple data class representing an attribute of a client, a room, or a user
account. Attribute instances represent a changed or deleted attribute, and
are passed to event listeners for the following events:
AttributeEvent.UPDATE, AttributeEvent.DELETE, RoomEvent.UPDATE_CLIENT_ATTRIBUTE,
RoomEvent.DELETE_CLIENT_ATTRIBUTE.
The following code shows a RoomEvent.UPDATE_CLIENT_ATTRIBUTE listener
that uses an Attribute object to manage the display of "moods"
in a chat application.
protected function updateClientAttributeListener (e:RoomEvent):void {
// Use getChangedAttribute() to retrieve the Attribute object.
// If the changed attribute's name is "MOOD", display the
// new mood.
if (e.getChangedAttr().name == "MOOD") {
trace("User " + e.getClient().getClientID()
+ " has a new mood: " + e.getChangedAttr().value;
}
}
}