<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -42,6 +42,7 @@
 	//////////////////// App Init ////////////////////
 	public function init():void {
 		
+		// generate random stream name
 		myKey = Math.random().toString().slice(2);
 		
 		// get camera
@@ -63,28 +64,29 @@
 		microphone.rate = 11; // 22 default
 		microphone.setSilenceLevel( 1, 2000 );
 		
-		// open connection
+		// create connection
 		nc = new NetConnection();
  		nc.objectEncoding = ObjectEncoding.AMF0;
  		nc.client = this; // setup server callback listener
  		nc.addEventListener( NetStatusEvent.NET_STATUS, netConnectionStatus );
  		nc.addEventListener( AsyncErrorEvent.ASYNC_ERROR , netConnectionStatus );
  		
- 		nc.connect(&quot;rtmp:/merconf/conf&quot;,myKey);
+ 		// connect to Red5
+ 		nc.connect(&quot;rtmp:/merconf/conf&quot;, myKey);
 	}
 	
-	////////////////////// SO setup /////////////////////
+	////////////////////// Shared Object setup /////////////////////
 	public function setupSO():void{
  		SO = SharedObject.getRemote(&quot;SO&quot;, nc.uri, false);
  		SO.addEventListener(SyncEvent.SYNC, syncSO, false);
   		SO.connect(nc);
 	}
 	
+	// called from so.setAttribute(&quot;streams&quot;,streams) on server
 	public function syncSO(event:Object):void{
-		publish();
+		if(!myStream) publish(); // start streaming to server
 		
 		var streams:Array = SO.data.streams;
-		debug(&quot;streams: &quot;+streams);
 		if(!streams) return;
 		videoBoxes.removeAllChildren();
 		for(var i:int = 0; i &lt; streams.length; i++) addStream(streams[i]);
@@ -107,7 +109,6 @@
 	
 	//////////////////////  Publish myStream ////////////////////
 	public function publish():void {		
-		if(myStream) return;
   		myStream = new NetStream(nc);
   		myStream.attachCamera(camera);
 		myStream.attachAudio(microphone);
@@ -120,7 +121,7 @@
 			debug(&quot;netStreamStatus: &quot;+event.info.toString()+&quot;, code:&quot;+event.info.code);
 	}
 	
-	
+	//////////////// Respond to Connection Events //////////////
 	public function netConnectionStatus( event : Object ):void {
 		if(event.info == null) return;
 		var info : Object = event.info;
@@ -157,8 +158,7 @@
 		
 		&lt;mx:Box width=&quot;0&quot; height=&quot;0&quot; id=&quot;_debug_window&quot; visible=&quot;false&quot;&gt;
 			&lt;mx:TextArea height=&quot;100%&quot; width=&quot;100%&quot; id=&quot;_debug&quot;/&gt;
-		&lt;/mx:Box&gt;	
-		
+		&lt;/mx:Box&gt;
 	&lt;/mx:VBox&gt;
 
 &lt;/mx:Application&gt;</diff>
      <filename>src/merconf_lite.mxml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>73b7c3fcef58e758b68ebc1d169fad34fcadd2f8</id>
    </parent>
  </parents>
  <author>
    <name>Nick Merwin</name>
    <email>mer@merair.local</email>
  </author>
  <url>http://github.com/yickster/merconf_client/commit/8f54e4ffa66c99ecec98f18b236578f688b783d4</url>
  <id>8f54e4ffa66c99ecec98f18b236578f688b783d4</id>
  <committed-date>2008-08-05T17:39:14-07:00</committed-date>
  <authored-date>2008-08-05T17:39:14-07:00</authored-date>
  <message>more comments</message>
  <tree>9ff89e15de59bbe54ee4b4dfaf762717d9344a65</tree>
  <committer>
    <name>Nick Merwin</name>
    <email>mer@merair.local</email>
  </committer>
</commit>
