Xiff as3 openFire user warning

I am using xiff_as3_flexlib_beta2.swc and openFire 3.3.0 and here are my findings.

In the past XIFF would connect right away and then the listeners would function together but using flex builder 2.155 with xiff_as3_flexlib_beta2.swc and openFire 3 you need a Timer object running to keep checking isLoggedIn and only after that start the listeners or you will get strange null object event errors that drive you crazy.

Logic tree

login Button pressed event

start timer

public function onTick (event:TimerEvent):void {

if(connection.isLoggedIn()) {

connection.addEventListener(“error”, error);

connection.addEventListener(“connectionSuccess”, connectionSuccess);

connection.addEventListener(“outgoingData”, outgoingData);

connection.addEventListener(“incomingData”, incomingData);

}

}

xiff as3 openFire user warning

trace("Is logged in: "+ connection.isLoggedIn()); returns false at first but it will later change and turn to true at a later time.

So the connection.addEventListener should not be turned on by default rather they should be turned on only

after connection.isLoggedIn() is true not when the application is complete.

I hope this message helps people with development. Let me know if it does.