all groups > flash (macromedia) > september 2007 >
You're in the

flash (macromedia)

group:

3X2 Grid loading XML data


3X2 Grid loading XML data multi-task
9/8/2007 8:39:58 PM
flash (macromedia):
I am stuck and it is buggin me. I am trying to load in XML data into a 3 x 2
grid of content boxes. Everything works fine except that it is only displaying
the last set of data from xml in all 6 content boxes. Here is how I am going
about it:



Code:
var numOfItems:Number;
var games:MovieClip = this;
////
xStart = Stage.width/2;
// where to start on the x axis
yStart = Stage.height/2;
// where to start on the y axis

//counter to keep track of what step we're on
counter = 0;
///spacing size of content boxes
spacing = 162;
////GetEm
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function() {
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
// 3X2 following loops.
for (var b = 1; b <=3; b++) {
for (var c = 1; c <=2; c++) {
counter++;
for (var i = 0; i<numOfItems; i++) {
var t = games.attachMovie("iconMC", "icon_MC" +counter, counter);
t._x = xStart+(b*spacing);
t._y = yStart+(c*spacing);
// We assign a _x position to the cell and _y

///////////////////////////////////////
////////////////LoadrestSetFunc
t.logo.logoContainer.loadMovie(nodes[i].attributes.logo);
t.t1.tText.text = nodes[i].attributes.title;
t.link = nodes[i].attributes.link;
t.onRollOver = over;
t.onRollOut = out;
t.onRelease = released;
}
}
}
};
xml.load("icons.xml");
Re: 3X2 Grid loading XML data cornelius
9/8/2007 11:34:39 PM
Not sure but does games exist.
Or try THIS instead.

How does your xml look
Re: 3X2 Grid loading XML data cornelius
9/8/2007 11:37:28 PM
can you show the fla?
AddThis Social Bookmark Button