Using Communication Components > Cursor component > Using the Cursor component

 

Using the Cursor component

This component is a simple implementation of an avatar—an image that represents a user on a virtual, multiuser Stage. When you implement this component, each pointer on the Stage represents one user's position in the communication application.

The following list describes several ways to use this component:

Educational applications: Drop this component into an e-learning application to enable all your users to point out parts of graphs, maps, or formulas during presentations, discussions, or questions.

Usability studies: Add this component to your application (for example, your website) to see how people use it.

Visual help for new interaction models: In multiuser applications, seeing the locations of all mouse pointers on the Stage gives each user a better sense of what other users are doing.

 
To use the component in your application:

1

Make sure Flash Communication Server is running.

2

Create a directory in the Flash Communication Server applications directory and name it cursor_test.

3

In the cursor_test directory, create a file named main.asc with the following code:

load("components.asc");

Note: You can also copy the main.asc file from another application directory to this application's directory.

4

Drag the Cursor component onto the Stage.

5

In the Property inspector, give the component an instance name, such as cursor_mc.

6

Drag the SimpleConnect component onto the Stage.

7

In the Property inspector for the SimpleConnect component, provide the following two parameters:

In the Application Directory text box, type the URI of the application that you created in Step 2: rtmp:/cursor_test.

Double-click the Communication Components text box. In the Values dialog box that appears, click the plus sign (+) and type the instance name of the Cursor component: cursor_mc. Click OK.

By providing this value, you are using the SimpleConnect component to handle the connection for the Cursor component. When the SimpleConnect component successfully connects to the server, the Cursor component automatically connects to the server.

8

Save and publish the file as cursor_test.swf.

9

Open the SWF file. (Alternatively, select Control > Test Movie in the Flash MX authoring environment.) Log in and click the Auto checkbox.

You see your pointer with your login name, as shown here. If you open more instances of the application, you will see additional pointers.