Hello,
I am trying to create a chat room and I am having a problem. I am following some of the example code that was provided with the older version of XIFF wherein the chat room is created and then the roomname and conference server name are set … like the following.
var chatRoom = new Room(connextion);
chatRoom.roomName = “testRoom”;
chatRoom.nickname = “testNick”;
chatRoom.conferenceServer = “conference.myserver”;
I get an error when setting roomName or conferenceServer no matter what order I set them in. The problem seems to be with the following code from Room.as.
/**
-
The conference server to use for this room. Usually, this is a subdomain of
-
the primary XMPP server, like conference.myserver.com.
*/
public function get conferenceServer():String
{
return myJID.split("@")[1];
}
/**
*/
public function set conferenceServer( aServer:String ):void
{
setRoomJID(roomName + “@” + aServer);
}
/**
- The room name that should be used when joining.
*/
public function get roomName():String
{
return myJID.split("@")[0];
}
/**
*/
public function set roomName( aName:String ):void
{
setRoomJID(aName + “@” + conferenceServer);
}
Nowhere in the code can I find where setRoomJID is called except in the setters for roomName and conferenceServer. So myJID is always null no matter which of the setters is called first. This would not be a problem except that each of the setters also references the other property causing its getter to be called … and the getter always tries to get the property by parsing (via split) the property myJID … which is always null.
I don’'t see how this could ever work, but surely someone must have chat rooms working … so what am I missing?
Bill Bailey