Display a message to all users in the room

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
pixelDepth
Posts: 11
Joined: 17 Mar 2006, 12:41

Display a message to all users in the room

Post by pixelDepth »

Hey,

I want to display a message to all users in the room. So when someone enters the room, I want to let everyone know "XXX has entered the room". I tried an extension, but it only displayed the message for the person who entered the room. I also tried a room variable, but for some reason, I couldn't get that to work.

Any ideas? :)

Thanks
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Post by Virusescu »

you have at your disposal an event handler on the client side API called onUserEnterRoom

Code: Select all

smartFox.onUserEnterRoom = function(roomId:Number, userObj:Object)
{
	trace("User " + userObj.getName()+" entered room with id "+roomId);
}
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
pixelDepth
Posts: 11
Joined: 17 Mar 2006, 12:41

Post by pixelDepth »

:o How did I miss that?

Thanks very much :) :D
Post Reply