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);
}