addChild needs to be called twice?

I have two classes, Init (which is my Document class) and LoadXML which… er… loads in some XML data.

Init calls the LoadXML and when it has completed a green backdrop is draw to the screen…


Why do I need to put addChild in both classes before the green backdrop (a simple rectangle) will show up.

    import flash.display.Sprite;
    import flash.display.Stage;
    public class Init extends Sprite{  

       // (*adminhost vars etc...*)

        public function Init(){
            var getPages = new LoadXML(adminhost,base,getposition,userRef);


  import flash.display.Sprite;
  import flash.display.Stage;
  import flash.utils.*;

  public class LoadXML extends Sprite
    public function LoadXML(ah,bs,gp,ur)
      var pageXMLloader:URLLoader = new URLLoader();
      //loader.dataFormat = DataFormat.TEXT;                                    //what is this?
      pageXMLloader.addEventListener(Event.COMPLETE, onLoadSuccess);
      pageXMLloader.load( new URLRequest(ah+bs+gp+"page_data.php?uRef="+ur));
    private function onLoadSuccess(event:Event){
        var pagesXML:XML = new XML(;        
        var pagesXMLList=pagesXML.children();
        var numpages=pagesXMLList.length();
        // At this point, example is ready to be used with E4X
        var makeRect:Sprite = new Sprite();
        //;, .3);, 0x000000, 1);,0,800,25);;
        makeRect.x = 0;
        makeRect.y = 0;
      } catch (e:TypeError) {
        // If we get here, that means the downloaded text could
        // not be converted into an XML instance, probably because 
        // it is not formatted correctly.
        trace("Could not parse text into XML");

The XML loads in, no problems…

the confusing thing is why I need the addChild twice, once in each class - otherwise the green box doesn’t show, no matter which one I take it out of?

And if its twice is that two green boxes on top of each other being added to the stage?
one at depth 0 and one at depth 1?

any help would be appreciated?