as far, as i can understand source code of smartfoxserver flash api, it does not support mx.events.EventDispatcher, so you can't use addEventListener method directly to api.
class SmartFoxClient have some abstract functions (onLogin, onRoomUpdate and so on), but this functions does not dispatch any events.
i see two ways to resolve this problem
1) you can modify smartfoxserver flash api and add any events you need. imho this is a not right way, but it will be work.
2) you can create your own proxy-class, what will be catch event from instance of SmartFoxClient and dispatch this events. something like this...
Code: Select all
import mx.utils.Delegate;
import mx.events.EventDispatcher;
import it.gotoandplay.smartfoxserver.SmartFoxClient;
class smartProxy {
public var smartServer : SmartFoxClient;
public var addEventListener : Function;
public var removeEventListener : Function;
private var dispatchEvent : Function;
function smartProxy() :Void {
EventDispatcher.initialize(this);
smartServer = new SmartFoxClient();
smartServer.onSomeEvent = Delegate.create (this, someEvent);
}
private function someEvent():Void {
var evtObj :Object = new Object ();
evtObj.target = smartServer;
evtObj.type = "someEvent";
dispatchEvent(evtObj);
}
}
i write this class directly in browser, so it can have some errors 
so, now you can create instance of this class instead instance of SmartFoxClient and use it public methods "addEventListener" and "removeEventListener"
p.s. forgive me for bad English, it is not my native language.