get smartfox events in openspace

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

Posts: 19
Joined: 05 Jan 2012, 07:21

get smartfox events in openspace

Postby kuzniz » 25 Feb 2014, 19:18


I would like to get the smartfox event in openspace flex project

getting the openspace events are by :

openSpace.addEventListener(LoggerEvent.INFO, onLoggerEvent)
openSpace.addEventListener(LoggerEvent.WARNING, onLoggerEvent)
openSpace.addEventListener(LoggerEvent.ERROR, onLoggerEvent)

I have tried to get the smartfox by

smartFox.logger.enableEventDispatching = true;
smartFox.logger.addEventListener(LoggerEvent.WARNING, onSFSLoggerEvent)
smartFox.logger.addEventListener(LoggerEvent.ERROR , onSFSLoggerEvent)
smartFox.logger.addEventListener(LoggerEvent.INFO , onSFSLoggerEvent)

did not recive anything ?

what do I do wrong ?

User avatar
Site Admin
Posts: 4355
Joined: 29 Mar 2005, 09:50
Location: Italy

Re: get smartfox events in openspace

Postby Bax » 26 Feb 2014, 09:49

Unfortunately there's a class naming conflict between OpenSpace and SmartFoxServer.
You have to do the following for example:

Code: Select all

smartFox.logger.addEventListener(com.smartfoxserver.v2.logging.LoggerEvent.WARNING, onSFSWarning);

public function onSFSWarning(e:com.smartfoxserver.v2.logging.LoggerEvent):void
   var msg:String = e.params.message;
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 5 guests