Can't connect to wildfire using xiff2

hey guys and gals,

i’m basing myself on b0ris’ work done on xiffian in order to implement a presence module in our project for e-learning here at melcoe. now, basically i’ve set up a class which manages the connection, room, and flash movieclip that actually shows the people in the room. i try connect to our jabber server and the “error” callback is caught but the event has no data… i have no clue what i’m doing wrong really. here are a few snipets.

class Presence extends MovieClip {

// XIFF things
private var connection:XMPPConnection;
private var room:Room;
private var myHost:InviteListener;
private var buddyList:Roster;
private var vcardManager:VCardManager;
private var privateData:PrivateDataManager;
private var globalHandler:Object;
private var chatHandler:Object;
private var userListener:Object;
private var timerConnection;
private var timerTestConnection;
private var ROOMCONNECTTIMEOUT:Number =10000;

connection = new XMPPConnection();
connection.username = “blahh”;
connection.password = “blahblah”;
connection.server = “”;
connection.port = 5222;

    var myDate = new Date();
    var h = myDate.getHours().toString(), m = myDate.getMinutes().toString(), s = myDate.getSeconds().toString();
    connection.resource = "XIFFIAN"+h+""+m+""+s;

connection.addEventListener(“message”, Proxy.create(this, handleGlobalEvent));
connection.addEventListener(“login”, Proxy.create(this, handleGlobalEvent));
connection.addEventListener(“connection”, Proxy.create(this, handleGlobalEvent));
connection.addEventListener(“disconnection”, Proxy.create(this, handleGlobalEvent));
connection.addEventListener(“presence”, Proxy.create(this, handleGlobalEvent));
connection.addEventListener(“error”, Proxy.create(this, handleGlobalEvent));
connection.addEventListener(“changePasswordSuccess”, Proxy.create(this, handleGlobalEvent));
connection.addEventListener(“outgoingData”, Proxy.create(this, handleGlobalEvent));
connection.addEventListener(“incomingData”, Proxy.create(this, handleGlobalEvent));
connection.addEventListener(“registrationSuccess”, Proxy.create(this, handleGlobalEvent));
connection.addEventListener(“registrationFields”, Proxy.create(this, handleGlobalEvent));



// Attempts connection and keeps trying until connection is established
private function attemptConnection(){
// Try first time

    // Keep trying
    timerConnection = setInterval(connectionTimer, ROOMCONNECTTIMEOUT);

private function connectionTimer(){
    Debugger.log('PRESENCE: attempting to connect',Debugger.MED,'connectionTimer','Presence');

// Checks to see if a connection has been established
private function checkConnectionEstablished(){
    // Check first time
    // Keep trying afterwards
    timerTestConnection = setInterval(connectionEstablishedTimer,500);    //Retry every half second

private function connectionEstablishedTimer(){
    Debugger.log('PRESENCE: checking if connection is established',Debugger.MED,'connectionEstablishedTimer','Presence');
        Debugger.log('PRESENCE: connection established',Debugger.MED,'connectionEstablishedTimer','Presence');
    Debugger.log('PRESENCE: is logged in?' + connection.isLoggedIn().toString(),Debugger.MED,'connectionEstablishedTimer','P resence');

private function handleGlobalEvent(eventObj) {
switch (eventObj.type) {

case “error”:
Debugger.log('PRESENCE: errorevent - error code: ' ’ - errorMessage: ’ +,Debugger.MED,‘handleGlobalEvent’,‘Presence’);

so what is going on here… does something seem extremely obvious? i’ve pretty much copy+pasted code from xiffian and mode mods from there. thanks a lot in advance!

p.s keep in mind that i’m using the same official v2 mxp library as b0ris is using for xiffian. the project i’m implementing this into is built in as2 with mx2004.

when i use my client using xiff to comment to openfire, this is what wireshark shows me:

44112 2548.764277 Jabber/XML Request: \000

and nothing more… any suggestion? my flash movie is being compiled with mx2004, as2.0. i’m using the unofficial xiff2 .mxp library


latest developments,

that policy thing is surely something to do with the crosspolicy.xml. so this is what i’ve been testing:

  • when i try connect to any jabber server from my app i get this policy request throw, with no response via http but flash does catch an error event which just so happens to contain no data. however, when i try connect to these same jabber servers using xiffian, everything works fine.
  • when i try to connect to my own jabber (openfire) server on localhost, same thing happens using my app. when i try connect to it using xiffian, xiffian crashes. strange stuff. bad configuration?

my question is, why would my app that uses exactly the same library as xiffian and almost the same code as xiffian not work on the same servers that xiffian can connect to? what am i possibly doing wrong? if there was a cross policy problem on the server it wouldn’t work for xiffian nor for my app. why is that request only popping up in my app? and am i not getting a server response?

thanks so much guys and gals, looking forward to getting an answer soon


this was fixed by changing the callbacks… they weren’t being called correctly.