• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. STEP 8: Collaboration with Sh... > How Does the Shared Cursor Work?

How Does the Shared Cursor Work?

The Shared Cursor traces your mouse movement using Flash's onMouseMove method. The component copies the x,y values to attributes within a remote SharedObject. When the data is copied, other Flash players are notified and can re-create your mouse and position. This allows you to “track” the mouse activity of connected users. Each user has a slot created within the SharedObject on the server. When data changes within the slot, notifications are sent to each connected client. The notifications are handled by the Flash player by setting the local x,y property to the value of the changed slot (or user). It's a handy tool that uses a simple concept and a great technique for handling data on the server. More will be discussed on the slot concept and the structure of the SharedObject after the next exercise.

The WhiteBoard uses Flash's drawing methods to create arrows and text annotations on the Flash stage. Other Flash players that are connected can see what is happening and add their annotations. Although there is a lot more going on with this application, the basic principle is the same. Each time a line is drawn the WhiteBoard component dynamically creates a new slot within the SharedObject on the server. This is why you can click a line and move it around. This process calls a series of special WhiteBoard methods that draw the new object on other Flash players.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint