I'm trying to add getBuddyRoom onto my Buddylist item's, but whenever an online buddy shows up, it says that the room they are in is undefined. Why would it do this?
I have attached an image of the result, as well as my code:
Code: Select all
public function LoadFromBuddy(_buddy: Object) {
m_buddy = _buddy;
var t1: String = "";
_buddy.isOnline ? t1 = "is Online!" : t1 = "Offline"
var _title: String = _buddy.name + " " + t1;
if (_buddy.isOnline == true){
dtf_room.text = "Inside: " + _buddy.getBuddyRoom
}
else{
removeChild(dtf_room)
}
dtf_title.text = _title;
_buddy.isOnline ? btn_invite.enabled = true : btn_invite.enabled = false;
_buddy.isOnline ? btn_invite.visible = true : btn_invite.visible = false;
_buddy.isOnline ? btn_teleport.enabled = true : btn_teleport.enabled = false;
_buddy.isOnline ? btn_teleport.visible = true : btn_teleport.visible = false;
}