title: AS3 - How to access an object instance from a separate class
body: <p>I have a game engine class that creates my main character instance and game border instance when the game is loaded like so:</p>
  
  <pre><code>public class Engine extends MovieClip
  {
       var char:Char = new Char(stage);
       stage.addChildAt(char, 1);
  
       var border1:Border = new Border();
       stage.addChild(border1);
  
      }
  </code></pre>
  
  <p>I would like to access the variable border1 that was created in the Engine class inside of my Char class.  Is this possible, and if so, how would I do it?</p>
  
  <p>I've tried changing the code so border1 is static like so</p>
  
  <pre><code>static var border1:Border = new Border();
  </code></pre>
  
  <p>But then I get </p>
  
  <pre><code>error 1012: The static attribute may be used only on definitions inside a class.
  </code></pre>