title: From AS2 to AS3 what is the equvalent of _root?
body: <p>I'm trying to learn Actionscript 2 or 3, with AS2 I eventually figured by trial and error that I could get any named instance and modify it using a string with its name using</p>
  
  <pre><code>var theinstance = "titletext"; // actually exctracted from an array
  _root[theinstance].htmlText = "New text with &lt;b&gt;HTML!&lt;/b&gt;";
  </code></pre>
  
  <p>but when trying to convert the code to AS3 <code>_root</code> doesn't exist anymore. According to the <a href="http://livedocs.adobe.com/flex/3/langref/migration.html" rel="nofollow noreferrer">migration doc</a> it is somehow replaced by <code>flash.display.DisplayObject.stage</code> but apparently this is not how to do it:</p>
  
  <pre><code>flash.display.DisplayObject.stage[theinstance].htmlText = "New text with &lt;b&gt;HTML!&lt;/b&gt;";
  </code></pre>
  
  <p>and neither is this:</p>
  
  <pre><code>flash.display.DisplayObject.stage.getChildByName(theinstance).htmlText = "New text with &lt;b&gt;HTML!&lt;/b&gt;";
  </code></pre>
  
  <p>How <em>do</em> I get a child by name in actionscript 3?</p>