Hi.
I have the following code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
total = xmlNode.childNodes.length;
i = 0;
xVar = 65;
yVar = 7;
while (i<total) {
_root.nume[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
_root.poza[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
_root.terenuri[i] =
xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
_root.link[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
_root.content_mc.attachMovie("imgHolder", "imgHolder"+i,
this.getNextHighestDepth(), {_x: xVar, _y: yVar});
xVar += imgHolder[i]._x;
trace(xVar);
++i;
}
return;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
_root.xml_file = "terenuri.xml";
xmlData.load(xml_file);
_root.nume = new Array();
_root.poza = new Array();
_root.terenuri = new Array();
_root.link = new Array();
And i want to target the imgHolder[i]; that i have just created through the
while function. I mean I attach a movieclip from the library to which I give a
name composed from "imgHolder"+i where i is the number of the node from the xml.
After that i want to succesfully target the newly created movieclip and get
it's _x so i can attach the next movieclip next to the previous one. After that
i will have a set of function based on the "imgHolder"+i movieclip.
But i need to know how to succesfully target the movieclip.
Thanks a lot.
kglad - 08 Jul 2008 15:15 GMT
use the attach code option to display code in this forum. otherwise, your code is altered and difficult to read.
_root.content_mc[ "imgHolder"+i]; // is your movieclip reference