title: Flex Dynamic object name, and add object to object?
body: <p>I have this situation where i'm trying to save "chat logs" while people switch around views in my flex mobile application..</p>
  
  <p>so, my plan is i'm starting out with a main object that I plan to re-use as the main chat log object..I call it <code>textObj</code></p>
  
  <p>so, when someone new wants to chat my plan is to make a new object with the persons username</p>
  
  <p>so how if i were to get the username from something like data.username how could I translate that into the var name of the object I want to make? So in the end i end up with</p>
  
  <pre><code>var uniqueUsername:Object = new Object();
  </code></pre>
  
  <p>so I can eventually do something like</p>
  
  <pre><code>uniqueUsername.chatLog="Sample text log";
  </code></pre>
  
  <p>EDIT: I guess I wasn't clear I dont literally mean uniqueUsername as the username....</p>
  
  <p>say <code>data.username</code> was equal to <code>AwesomeDudeYeah</code></p>
  
  <p>and I wanted to make</p>
  
  <pre><code>var AwesomeDudeYeah:Object = new Object();
  </code></pre>
  
  <p>I cant just do</p>
  
  <pre><code>var data.username:Object = new Object();
  </code></pre>
  
  <p>so how could I make that work?</p>
  
  <p>I want to make the username how I refer to the chat logs inside the textObj</p>
  
  <p>Then how would I go about adding that to the textObj obj?</p>
  
  <p>So i end up with <code>textObj.uniqueUsername.chatLog="Sample text log";</code></p>
  
  <p>which i could reference by doing <code>textObj[uniqueUsername][chatLog]</code> </p>
  
  <p>(at least I think thats how it would be done)</p>
  
  <p>Any help on these topics would be great!</p>