Listing 1

<!-- Instance of the FlashComm object. Note how the events declared in the
     ActionScript file are named here and processed.
  -->
<FlashComm id="flashComm"
	change="showNewData(event)"
	users="updateUsers(event.data)"
	failed="mx.core.Application.alert('Failed to connect to the server','Alert')" />

Listing 2

<mx:Repeater id="dropZones" dataProvider="{userList}" recycleChildren="true">
	<mx:VBox width="100" label="{dropZones.currentItem.name}"
	             dragEnter="doDragEnter(event)" 
	             dragOver="highlightDragTarget(event)"
	             dragExit="restoreDragTarget(event)"
	             dragDrop="doDragDrop(event); dataGrid.selectedIndices=null;" >
	<mx:Image source="@Embed('computer_mail.gif')" />
		<mx:Label text="{dropZones.currentItem.name}" widthFlex="1"
textAlign="center" />
	</mx:VBox>
</mx:Repeater>

Listing 3

/* onAppStart is invoked when the application is initially loaded.
 */
application.onAppStart = function()
{
	// Get the server shared object 'orders'
	application.rowData_so = SharedObject.get("orders", false);	
}

/*
 * onConnect is invoked every time a client connects. The newClient
 * object is created automatically by the Flash Comm Server to represent
 * the client connection. The name parameter was passed from the client.
 */
application.onConnect = function(newClient, name)
{
	// Make this new client's name the user's name
	newClient.name = name;

	// Accept the client's connection. You could also reject this
	// connection if appropriate.
 	application.acceptConnection(newClient);

	// The client will call this function to get the server
	// to broadcast the orders to everyone. The 'receiveOrders'
	// method being remote invoked has been defined by each client.
	newClient.sendOrders = function(orderData) {
		application.rowData_so.send("receiveOrders",this.name,orderData);
	}
}