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

Chapter 8. Shared Objects > Avoiding Collisions

8.8. Avoiding Collisions

When a movie attempts to update slots in a shared object, the server locks the properties of the server-side copy of the shared object the movie is attempting to update. Any other movies that attempt to update a slot while it is locked will receive an information object with a code value of "reject" for each locked slot in the list passed into the shared object's onSync( ) method. So, if multiple movies attempt to update the same property of a shared object at nearly identical times, only one movie will succeed. The other movies will receive notice that their change requests were rejected. In some applications, rejected updates are an inevitable and necessary feature of the application. In others, steps should be taken to avoid slot update collisions. For example, it is interesting to see several people try to control the shared ball at the same time. The ball may move erratically around the Stage, but no harm is done. However, multiple users sharing a whiteboard application will prefer that each person has complete control of a drawing tool and can complete part of a drawing without interference from other users.

Here are a number of ways to avoid shared object slot update collisions:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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