Creating a cooperative drawing whiteboard

We have created a basic example to log in to the SmartFoxServer. Now we are going to create a whiteboard so every connected user can draw on the same whiteboard.

The concept is to add mouse listeners to handle the event when mouse is down, mouse moves, and mouse is up. When the mouse is down and moves, the application broadcasts the mouse coordination to all users within the room and all users then draw the lines according to the received coordination.

We will have a glance of the full code and explain it part by part in detail.

package { import it.gotoandplay.smartfoxserver.SmartFoxClient; import it.gotoandplay.smartfoxserver.SFSEvent; import it.gotoandplay.smartfoxserver.data.Room; import it.gotoandplay.smartfoxserver.data.User; ...

Get Flash Multiplayer Virtual Worlds now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.