I’m having a bit of a strange problem:
On my stage I have 2 dummy movieclips that I duplicate and I give the a text value.
As you can see below:
The XML file is build like this:
** <gallery name=“XXXX”>
<image src=“imgs/XXXX.jpg”/>
</gallery>**
So as you can see for the gallery names the duplication works perfectly, but
for the images not
It only shows the last one, but if I trace the names of the duplicated buttons I can see them all
Here is my code:
[AS]
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success) {
if(success) { //xml loaded
var galleries = this.firstChild.childNodes;
for(var i=0;i<galleries.length;i++) {
var gallery = galleries*;
_root.txt.text += gallery.attributes.name + "
";
var images = gallery.childNodes;
//>> MENU >> Title
duplicateMovieClip(_root.dmyTitel,"titel_" + i,i);
_root["titel_" + i]._x = 50;
if(i == 0) {
_root["titel_" + i]._y = 50;
} else {
var a=i-1;
_root["titel_" + i]._y = (_root["titel_" + a]._y + (_root["titel_" + a]._height + 25));
}
_root["titel_" + i].txt.text = gallery.attributes.name;
//>> MENU >> Title >> Number
var xvalue = 55;
var yvalue = _root["titel_" + i]._y + 17;
for(var j=0;j<images.length;j++) {
var image = images[j];
_root.txt.text += " + " + image.attributes.src + "
";
dmyNr.duplicateMovieClip("nummer_" + i + "_" + j,100+i+1);
_root["nummer_" + i + "_" + j].nr.text = j + 1;
setProperty(_root["nummer_" + i + "_" + j],_name,"nummer_" + i + "_" + j);
xvalue += j*20;
if(j%3 == 0 && j>0) {
yvalue += 17;
xvalue = 55;
}
setProperty(_root["nummer_" + i + "_" + j],_x,xvalue);
setProperty(_root["nummer_" + i + "_" + j],_y,yvalue);
trace(_root["nummer_" + i + "_" + j]._name + " : " + xvalue + " : " + yvalue);
//var url = image.attributes.src;
//trace("---------------------------- " + url);
_root["nummer_" + i + "_" + j].onRelease = function() {
//iiiiieeeek!!!!
//trace("#### " + _root["nummer_" + i + "_" + j] + " : " + url);
}
}
}
} else trace("Error while loading XML...");
}
my_xml.load(“vogels.xml”)
[/AS]
Thx for your help…