# Problem

**URL:** <https://forum.kirupa.com/t/problem/261129>\
**Category:** Uncategorized\
**Created:** [May 23, 2008, 1:18pm UTC](https://forum.kirupa.com/t/problem/261129 "2008-05-23T13:18:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![moiseszaragoza](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@moiseszaragoza](https://forum.kirupa.com/u/moiseszaragoza)\
**Post date:** [May 23, 2008, 1:18pm UTC](https://forum.kirupa.com/t/problem/261129/1 "2008-05-23T13:18:02Z")

</div>

Well i am trying to organise my code and i have moved some files around. I have been keeping track of my functions and i am not getting any ouput errors just that my images and text are not showing up.  
I think there is a problem with the [glow=red,2,300]addChild()[/glow]

Main.as

```auto

 
package {
 import flash.display.*;
 
 public class Main extends Sprite {
  public function _giftCardRoot() {
   var MainFunctions:_Class_MainFunctions = new _Class_MainFunctions();
   MainFunctions.LoadXML("category.aspx");
  }
 }
}

```

Class\_MainFunctions.as

```auto

package {
 import flash.display.*;
 import flash.events.*;
 import flash.net.*;
 import flash.text.*;
 import flash.filters.*;
 
 public class Class_MainFunctions extends Sprite {
  private static const thumbHSpace:int=140;
  private static const thumbVSpace:int=120;
  private static const thumbXOffSet:int=140;
  private static const thumbYOffSet:int=95;
  private var XMLData:XML;
  public var textFormat:TextFormat;
  public function LoadXML(myXMLFile):void {
 
   var xmlURL=new URLRequest(myXMLFile);
   var xmlLoader:URLLoader=new URLLoader(xmlURL);
   xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);
  }
  private function xmlLoaded(event:Event):void {
   var xmlData=new XML(event.target.data);
   parseXML(xmlData);
  }
  public function parseXML(input:XML):void {
 
   var hc:int=0;
   var vc:int=0;
   var category:XMLList=input.category;
   textFormat=new TextFormat ;
   textFormat.font="Verdana";
   textFormat.size=11;
   textFormat.bold=true;
   textFormat.color=0x990000;
   for each (var infoXML:XML in category) {
    var catName=new TextField ;
    var catImg=new TextField ;
    catName.x=hc * thumbHSpace + thumbXOffSet;
    catName.y=vc * thumbVSpace + thumbYOffSet;
    catName.text=infoXML.categoryName;
    catName.setTextFormat(textFormat);
    catName.width=150;
    if (hc < 3) {
     hc++;
    } else {
     hc=0;
     vc++;
    }
    addChild(catName);
 
 
 
   }
  }
}

```
