A common use of buddy list is sending private messages to buddies. In some cases, we may be playing a game in virtual world and want to ask whether my friend wants to join it. We can open up the buddy list within the game and send a private message out. We are going to implement it by using the built-in private message feature.
We added a private message button in the info panel. A private message panel prompts out when we click on the button. After the player inputs some text and clicks on send, we construct the private message in a format to include the recipient's name. We need the recipient's name to display in the chat dialog panel. The chat message is composed in following format:
Sender|recipient|private message
The following code in PrivateMessagePanel.as
sends out the private message. We need to check if the recipient is from current room or buddy list in order to get the recipient's user ID.
private function clickSendBtn(e:MouseEvent):void { var targetBuddyId...