I’m trying to target a specific tag and its children with a function I have.
I have two functions written basically the same, except one is trying to reference a target. For some reason on the one trying to reference a target, I get the XML tag names still attached to the URL. Does anyone know why this would happen in one function and not the other?
Working function:
function fileLoaded(event:Event):void {
myXML = XML(event.target.data);
xmlList = myXML.children();
ParseProperty(myXML);
loadFeature();
for (var i:int=0; i<xmlList.length(); i++) {
var picURL:String = xmlList*.img;
var picName:String = xmlList*.big_img;
arrayURL.push(picURL);
arrayName.push(picName);
holderArray* = new Thumbnail(arrayURL*,i,arrayName*);
holderArray*.addEventListener(MouseEvent.CLICK,onClick);
holderArray*.name = arrayName*;
holderArray*.buttonMode = true;
if (i<nrColumns) {
holderArray*.y = 65;
holderArray*.x = i*110+85;
} else {
holderArray*.y = holderArray[ i-nrColumns].y+110;
holderArray*.x = holderArray[ i-nrColumns].x;
}
thumbsHolder.addChild(holderArray*);
}
}
Function with tag names still in arrayURL:
function propertyLoaded(propertyInfo:XML):void {
var propertyList:XMLList = propertyInfo.house.(big_img == propertyTarget);
for (var i:int=0; i<propertyList.length(); i++) {
var picURL:String = propertyList.interior;
var picName:String = propertyList*.big_img;
arrayURL.push(picURL);
arrayName.push(picName);
holderArray* = new Thumbnail(arrayURL*,i,arrayName*);
//holderArray*.addEventListener(MouseEvent.CLICK,onClick);
holderArray*.name = arrayName*;
holderArray*.buttonMode = true;
if (i<nrColumns) {
holderArray*.y = 65;
holderArray*.x = i*110+85;
} else {
holderArray*.y = holderArray[ i-nrColumns].y+110;
holderArray*.x = holderArray[ i-nrColumns].x;
}
thumbsHolder.addChild(holderArray*);
}
trace(propertyTarget);
}
I assume there is some rule I am not aware of yet.
This is the output I’m getting:
Error #2044: Unhandled ioError:. text=Error #2035: URL Not Found. URL: file:///C|/Users/Dav%20id/Documents/Business/Luxury/<interior>lux_images/img1_s.jpg</interior>
<interior>lux_images/img1_s.jpg</interior>
<interior>lux_images/img1_s.jpg</interior>
<interior>lux_images/img1_s.jpg</interior>
Thanks for any help!