 			{
 				disposeObjects(stateLog);
 				stateLog = null;
+			}
+		}
+		//If the Session state changes in anyway, a diff is created and stored in the
+		//StateLog history. The latest entry is than sent to the server, to be sent
+		//to everyone else to update their collaboration session.
+		private function handleStateChange():void
+		{
+			// note: this code may need to be changed later if SessionStateLog implementation changes.
+			if (connectedToRoom && stateLog != null)
+			{
+				var log:Array = stateLog.undoHistory;
+				if (synchronizingIncomingDiff)
+				{
+					log.pop(); // suppress the outgoing diff that results from an incoming diff
+				}
+				else
+				{
+					var entry:Object = log[log.length - 1];
+					sendSessionStateDiff( entry.id, entry.forward );
+				}
 			}
 		}
 		

						var ssm:SessionStateMessage = o as SessionStateMessage;
						if (userAlias == this.username)
						{
							// received echo back from local state change
							// search history for diff with matching id
							var foundID:Boolean = false;

		//Handles Sending the entire session state. Should only be used if
		//someone needs a hard reset, or joining the collaboration server
		//for the first time.
		public function sendFullSessionState( diffID:int, diff:Object, target:String ):void
		{
			var message:FullSessionState = new FullSessionState(diffID, diff);
			sendEncodedObject( message, target );
		}
		
		//Handles sending session state changes
		public function sendSessionStateDiff( diffID:int, diff:Object ):void
		{
			//dispatchLogEvent('\nOUTGOING ' + diffID + ' ' + ObjectUtil.toString(diff) + '\n--------------------------\n');
			var message:SessionStateMessage = new SessionStateMessage(diffID, diff);
			sendEncodedObject(message, null);
		}
		
		//When a message is recieved pass it on to the user
