Xml php HELP!

Hey Kirupa folks,
I’ve been beating my brains over the following AS3 code. It displays an image in several symbols in my movie, and it works great on the first run or so, and then when you try to use a different idName, the movie will show up, but the images won’t.

I’m using php to say things like www.example.com/example.php?id=55798 to send the id number to an xml file that this code gets the idName from.

Any help is greatly appreciated - thanks!

Here is the code on the main timeline:
stop();

var counterLoader:URLLoader = new URLLoader();
var counterURL:URLRequest = new URLRequest(“yourkaleid.xml”);
counterLoader.addEventListener(Event.COMPLETE, counterLoaded);
counterLoader.load(counterURL);

var counterXML:XML = new XML();
counterXML.ignoreWhitespace = true;
var imageLoc:String;
var idName:int;

function counterLoaded(evt:Event):void {
counterXML = XML(counterLoader.data);
idName = counterXML.idname;
trace(idName);
}

var xmlLoader:URLLoader = new URLLoader();
var tripsURL:URLRequest = new URLRequest(“images.xml”);
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
xmlLoader.load(tripsURL);

var tripsXML:XML = new XML();
tripsXML.ignoreWhitespace = true;

function xmlLoaded(evt:Event):void {
tripsXML = XML(xmlLoader.data);

var tripNumber:int = idName-55798;
imageLoc = “uploads/”+tripsXML.trip[tripNumber].image;
//trace (imageLoc);

this.pic1.pic1a.ldImage.source = imageLoc;
this.pic2.pic1a.ldImage.source = imageLoc;
this.pic3.pic1a.ldImage.source = imageLoc;
this.pic4.pic1a.ldImage.source = imageLoc;
this.pic5.pic1a.ldImage.source = imageLoc;
this.pic6.pic1a.ldImage.source = imageLoc;
this.pic7.pic1a.ldImage.source = imageLoc;
this.pic8.pic1a.ldImage.source = imageLoc;
this.pic9.pic1a.ldImage.source = imageLoc;
this.pic10.pic1a.ldImage.source = imageLoc;
this.pic11.pic1a.ldImage.source = imageLoc;
this.pic12.pic1a.ldImage.source = imageLoc;
this.pic13.pic1a.ldImage.source = imageLoc;
this.pic14.pic1a.ldImage.source = imageLoc;
this.pic15.pic1a.ldImage.source = imageLoc;
this.pic16.pic1a.ldImage.source = imageLoc;
this.pic17.pic1a.ldImage.source = imageLoc;
this.pic18.pic1a.ldImage.source = imageLoc;
this.pic19.pic1a.ldImage.source = imageLoc;
this.pic20.pic1a.ldImage.source = imageLoc;
this.pic21.pic1a.ldImage.source = imageLoc;
this.pic22.pic1a.ldImage.source = imageLoc;
this.pic23.pic1a.ldImage.source = imageLoc;
this.pic24.pic1a.ldImage.source = imageLoc;

}