02.02.2013 Views

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 23: Using <strong>Flash</strong> Communication Server<br />

then the code from line 75 is executed. Here we make the value of the variable ‘avatar’ point at<br />

the avatar just clicked and set the used and name values for the shared object. The same function<br />

is used <strong>to</strong> initiate a dragging by creating an ‘onMouseMove’ function. Lines 83 and 84 pass the<br />

value of the mouse <strong>to</strong> the shared object. The definition of the ‘onRelease’ and ‘onReleaseOutside’<br />

functions is defined in lines 90 <strong>to</strong> 92.<br />

Finally in lines 186 <strong>to</strong> 223 we use the value of ‘id’ in the variable ‘avatar’ <strong>to</strong> update the shared<br />

object as the user disconnects.<br />

Examining what is happening on the server<br />

You can see from the code that most of the communication is handled by the shared object. It is<br />

possible <strong>to</strong> do many of the things that you will want <strong>to</strong> do as a game developer by concentrating<br />

solely on the client-side scripting. But even then it is useful <strong>to</strong> see what is going on behind the<br />

scenes. Use ‘Start/Macromedia/<strong>Flash</strong> Communication Server <strong>MX</strong>/Administration Console’ <strong>to</strong><br />

open up the admin screens.<br />

Figure 23.9 Connecting <strong>to</strong> the server for administrative tasks<br />

369

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!