title: Calling MovieClip(root) from a dynamic MovieClip instance produces error 1034
body: <p>NINJA EDIT:
  For some reason, the same code works now, without any problem at all. I don't know what happened, or why, but I no longer have this problem</p>
  
  <h2>Here's the original post:</h2>
  
  <hr>
  
  <p>To put simply, I created a MovieClip, put it with addChild() to stage, and when I tried to call this piece of code:</p>
  
  <pre><code>MovieClip(root).someFunction();
  </code></pre>
  
  <p>It throws Error #1034: Type Coercion failed: cannot convert flash.display::Stage@4034f71 to flash.display.MovieClip.</p>
  
  <p>I really can't figure out why this piece of code won't work. The object itself works perfectly, as I can call functions within it (that line of code is actually within a function). It's just that piece of code that is problematic</p>
  
  <p>Can someone tell me where I went wrong?</p>
  
  <p>EDIT:
  To better illustrate the situation, here's my pieces of code:</p>
  
  <p>in a MovieClip, I have this function:</p>
  
  <pre><code>function bombReset():void
  {
      bBombIsDropped = false;
      tCarpetBombTween.gotoAndStop(0);
      this.visible = false;
      MovieClip(root).carpetBombAttack(iPosition);
  }
  </code></pre>
  
  <p>And on Scene1(root, the outermost parent) I have this function:</p>
  
  <pre><code>function carpetBombAttack(position:int):void
  {
      damagePlant(15,vTileOccupant[(position-1)]);
  }
  </code></pre>
  
  <p>If I create a MovieClip instance via addChild and call bombReset in it, Flash will throw an error</p>
  
  <p>If I manually drag the MovieClip onto stage, when I call bombReset, it will work fine</p>