title: AS3 - Access variable in root from class
body: <p>How to access a variable in the root timeline from within a class? There is a variable called <strong>myblocks</strong> in the root timeline I need to read the value from.</p>
  
  <p>This is the related class part:</p>
  
  <pre><code>package myclasses
  {
  
  public final class Bcoder extends EventDispatcher
      {
  
  private function getBlocks():void
          {
  
              for (var i:int = _getNumBlocks; i--; ){
              // how to get the myblocks value from here?
  
              }}
  </code></pre>
  
  <p>This is from the root timeline: (ActionScript stands in a keyframe)</p>
  
  <pre><code>    import myclasses.Bcoder;
  var myblocks:Number=20
  </code></pre>