title: ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller error - AS
body: <p>I have this code snippet inside a function that checks if an object exists on stage and removes it:</p>
  
  <pre><code>public function closeContent(e:MouseEvent):void { 
      removeChild(txt);
      removeChild(ldr.content);
      removeChild(_closeButton);
      container_mc.visible = false;
      statusText.text="";
      if (contains(submitButton)) {
          removeChild(submitButton);
      }
      if (contains(saveinfoButton)) {
          removeChild(saveinfoButton);
      }
  }
  </code></pre>
  
  <p>I tried to change <code>stage</code> with <code>this</code> and <code>root</code> but always get this error <code>ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller</code></p>