title: How to access dynamic text field on stage from within the document class
body: <p>I'm trying to access a text input that I've already placed on the stage (inside a movie clip) but with no luck.</p>
  
  <p>I've defined an instance name for this dynamic text field which is currentUserCount</p>
  
  <p>I've got something like this set up in the document class actionscript file:</p>
  
  <pre><code>package {
  
      import flash.events.Event;
      import flash.net.URLLoader;
      import flash.net.URLRequest;
      import flash.display.Sprite;
      import flash.display.DisplayObject;
      import flash.display.MovieClip;
      import flash.display.Stage;
      import flash.text.TextField;
      import flash.text.TextFieldAutoSize;
      import flash.text.TextFormat;
  
      public class myProject extends Sprite {
  
          public function myProject() {
              // Trying stuff like
              trace(currentUserCount);
              trace(movieClipName.currentUserCount);
              trace(root.currentUserCount);
          }
      }
  }
  </code></pre>
  
  <p>What am I missing?</p>
  
  <p>When I run this I get:</p>
  
  <pre><code>1120: Access of undefined property currentUserCount.
  1120: Access of undefined property movieClipName.
  1119: Access of possibly undefined property movieClipName through a reference with static type flash.display:DisplayObject.
  1120: Access of undefined property currentUserCount.
  </code></pre>