To whom it may concern,

Hi, I recently started programing in actionscript and decided to create a webpage for somebody, that pulls information out of an xml file and generates movieclips with textfields, that show that information.

So far I have an empty stage with script on the first frame and a movieclip in the library, that's exported for actionscript as "textContainer" and includes, mentioned above, dynamic text fields with instance names "itemName", "itemDescription", and "itemPrice" respectively.

When I run the program, it gets to 'trace("vars specified")' while stage is still empty and nothing is happening. If somebody could possibly help me out solving this or could give me an advice on fixing the code, it would be much appreciated!

Thanks for your time.

PS:
the code:

import flash.display.MovieClip;
import flash.events.Event;
import flash.display.Stage;
var getMenu:URLRequest;
var currentIndex:Number=0;
var xml:XML;
var menulist:XMLList;
var loader:URLLoader = new URLLoader();//create a new URLLoader Object
loader.addEventListener(Event.COMPLETE, whenLoaded);//add an event listener to that object
loader.load(new URLRequest("menu.xml"));//Requests xml file that contains our menu data
trace("menu xml loaded");

function whenLoaded(e:Event):void {
xml=new XML(e.target.data);
menulist=xml.menuItem;//accesses item tag in xml file
trace("items pulled");
var textContainersArray:Array = new Array ();
var itemNumber:uint=menulist[currentIndex];
var textContainerY:int=0;
trace("vars specified");
for (itemNumber=0; itemNumber < menulist.length; itemNumber++) {
trace("item number ", itemNumber);
var textContainers:textContainer = new textContainer();
textContainersArray.push(textContainers);
addChild(textContainersArray[itemNumber]);
textContainerY=textContainerY+50;
textContainers.y=textContainerY;
textContainers.x=200;
textContainers.itemName.text=menulist[currentIndex].itemName;//gets item name from xml
textContainers.itemDecription.text=menulist[currentIndex].itemDescription;//gets item Description
textContainers.itemPrice.text=menulist[currentIndex].itemPrice;//gets item Price
trace("item ", itemNumber," placed");
}
}