title: Problem with this and root in Actionscript 2.0
body: <p>To start with, I'm not new to actionscript (AS2.0) neither am I an experienced programmer in this language and I barely use any of it's object oriented features (frankly, I've never even written a class). Anyway, This is my code</p>
  
  <pre><code>
  var instName;
  var num=0;
  setInterval(createSym,100);
  function createSym(){
      instName="sym"+num++;
      this.attachMovie("sym",instName,this.getNextHighestDepth());
      eval(instName)._x=100;
      eval(instName)._y=100;  
      var t1=setInterval(moveSym,8,instName);
      function moveSym(instName){
          eval(instName)._x+=1;
      }
      var t2=setInterval(checkSym,1,instName);
      function checkSym(instName){
          if(eval(instName)._x>=600){
              clearInterval(t1);
              clearInterval(t2);
              eval(instName).removeMovieClip();
          }
      }
  }
  </code></pre>
  
  <p>At first I thought I'm having some kind of scope problem with nested functions but I've accidentally used the same logic in another program and it works perfectly (I would also appreciate some help in understanding how runtime memory is managed in languages like this). But then I realized that this code works if I change <strong>this</strong> in <strong>this.attachMovie</strong> to <strong>_root</strong> or if I change calling technique (without changing <strong>this</strong> to <strong>_root</strong>) to </p>
  
  <pre><code>
  setInterval(mycaller,100);
  function caller(){
       createSym();
  }
  </code></pre>
  
  <p>I can't make out how these two ways differ from each other. Thanks for any help with this :)</p>