 	import flash.events.AsyncErrorEvent;
 	import flash.events.StatusEvent;
 	import flash.net.LocalConnection;
+	import flash.net.registerClassAlias;
 	import flash.utils.ByteArray;
 	
 	import mx.rpc.AsyncResponder;

	 * This class provides two-way communication between Flash applications in the form of an IAsyncService.
	 */	
	public class LocalAsyncService implements IAsyncService, IDisposableObject
	{
		/**
		 * @param receivingObject The object to receive remote commands from.
		 * @param receivingObjectIsServer If true, receivingObject acts as the server and listens for the remote object acts as a client.

				var chunkData:ByteArray = new ByteArray();
				var chunkSize:uint = Math.min(tempByteArray.bytesAvailable, 39900); // size limit for send data is 40k
				tempByteArray.readBytes(chunkData, 0, chunkSize);
				moreChunksFollow = (tempByteArray.bytesAvailable > 0);

				// chunkData was chunkData.toString() before because byteArray is sometimes encoded as a generic object
				// but I can't reproduce it and this fixes a bug with a unicode character (such as the greek lowercase mu, char code 181).
				// the unicode char bug occurs during the toString() call which results in a string with a smaller size than the bytearray.
				conn.send(remoteName, "receiveChunkedData", commandID, chunkID++, chunkData, moreChunksFollow);
			}
		}

