title: Flash AS3: Getting this error: Access of undefined property - basic scope help needed :(
body: <p>I'm still used to the AS2 style of all code on 1 frame, I'm trying to code AS3 in class files and I'm having a problem with a basic package setup. Scope issues are killing me with trying to learn AS3. Below is my package code, I don't have any other class files, just trying to return a simple trace.</p>
  
  <p>The error I'm getting after I run the code below: <strong>1120: Access of undefined property tc.</strong></p>
  
  <hr>
  
  <h2>Main Class</h2>
  
  <pre><code>package 
  {
      import src.*;
      import flash.display.MovieClip;
  
      // Custom imports to go here
      import src.tradeclass.TradeFrame;   
  
      public class TraceClass extends MovieClip
      {
          public var tc:TradeFrame;
  
          public function TraceClass(traceText:String):void
          {
              // Constructor function
          }
  
      }
  
      tc = new TradeFrame("hello");
      //TraceClass.TradeFrame("hello");
  
  }
  </code></pre>
  
  <hr>
  
  <h2>Sub Class</h2>
  
  <pre><code>package src.traceclass 
  {
      import src.*;
      import flash.display.MovieClip;
  
      public class TradeFrame extends MovieClip
      {
  
          public function TradeFrame(traceText:String):void
          {
              // Constructor function
              trace(traceText);
          }
      }
  }
  </code></pre>