Displaying number of users in the Rooms

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

Post Reply
solveProblems()
Posts: 8
Joined: 21 Jun 2011, 12:39
Location: Brazil

Displaying number of users in the Rooms

Post by solveProblems() »

I searched for a topic like this but I couldn't find anything so, I'm posting a new one !

I have being building a MMO game with SFS2 with Flash (As3) and know I'm currently almost done. But there's still a question that I could not figure it out (Sorry, I'm really noob), How do I display the number of player in some room to the other users?

I have 4 rooms in 1 zone and I would like to display in the lobby the number of user in each room.

If anyone can give me the answer or at least some direction I'd be really happy.
if (problemSolved == false)
{
stress += 10
}
else
{
celebrate(stress)
}
solveProblems()
Posts: 8
Joined: 21 Jun 2011, 12:39
Location: Brazil

Post by solveProblems() »

Just for you guys to know

I tried this http://www.smartfoxserver.com/docs/docP ... ountChange

And I got this error

#1119: Access of possibly undefined property onUserCountChange through a reference with static type Class.
if (problemSolved == false)
{
stress += 10
}
else
{
celebrate(stress)
}
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

Hi. Did you realize that you're using the wrong documentation? That documentation is for SFS1x. For SFS2x AS3 Client API Documentation go to:

http://docs2x.smartfoxserver.com/api-docs/asdoc/

And to check the SFS2x documentation simply go to http://docs2x.smartfoxserver.com/
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
solveProblems()
Posts: 8
Joined: 21 Jun 2011, 12:39
Location: Brazil

Post by solveProblems() »

Oh my God !

I'm so sorry for being such a noob, thanks so much.

I'm going to try solving this problem, now it's gonna be possible because, er, I got the right documentation.

Once again thanks so much
if (problemSolved == false)
{
stress += 10
}
else
{
celebrate(stress)
}
solveProblems()
Posts: 8
Joined: 21 Jun 2011, 12:39
Location: Brazil

Post by solveProblems() »

If there's anyone out there please explain to me

http://docs2x.smartfoxserver.com/api-do ... USER_COUNT

What does " ${UC}" means?
if (problemSolved == false)
{
stress += 10
}
else
{
celebrate(stress)
}
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

@solveProblems, those are the internal strings representing the constants.
Paolo Bax
The SmartFoxServer Team
solveProblems()
Posts: 8
Joined: 21 Jun 2011, 12:39
Location: Brazil

Post by solveProblems() »

I solved the problem with this:

Code: Select all


var myRoom:Room = Global.mainClass.sfs.roomList[i] as Room;

myRoom is a temporary instance.
Global.mainClass.sfs is my smartfox instance.
roomList is a properti that returns a array with the rooms in it.
is for me to get all rooms (in a simple for).

Thanks everyone, I hope this thread helps someone in the future.
if (problemSolved == false)
{
stress += 10
}
else
{
celebrate(stress)
}
Post Reply