powered by Jive Software

Send a Private Messsage Using Flex

You folks have been very helpful. I have the AS3 version of Xiff working and most of the code to connect to my server. The last thing I need is how to send a private message. Here’s the code so far:

public function XMPPconn(): void

{

var msg:Message = new Message("riddler@someserver.com", null, "Hello World!", "foo", Message.CHAT_TYPE);

var connection:XMPPConnection = new XMPPConnection();

connection.useAnonymousLogin = false;

connection.username = “rbottoms”;

connection.password = “xxxxxx”;

connection.server = “someserver.com”;

connection.port = 5222;

connection.addEventListener(ConnectionSuccessEvent.CONNECT_SUCCESS, handleConnectSuccess);

connection.addEventListener(IncomingDataEvent.INCOMING_DATA, handleIncomingData);

connection.addEventListener(OutgoingDataEvent.OUTGOING_DATA, handleOutgoingData);

connection.addEventListener(LoginEvent.LOGIN, handleServerLogin);

connection.connect(“flash”);

}

private function handleConnectSuccess(event:ConnectionSuccessEvent):void{

trace(“Connected!”);

}

private function handleServerLogin(event:LoginEvent):void{

trace(“Login event received”);

// roster.setPresence(null, “Online”, 5);

}

private function handleIncomingData(event:IncomingDataEvent):void{

trace("Received: " + event.data);

}

private function handleOutgoingData(event:OutgoingDataEvent):void{

trace("Sent: " + event.data);

}

Really could use some help with this last bit. I’d read the docs on the subject but there don’t seem to be any.

Thanks

Hi rbottoms,

Do you know how to receive a message using the XIFF beta…?.. can you please share me some basic operations like

getting room list, getting user list, receiving private messages on private chat ?

thanks

Viv