I have logos coming from an xml doc which there are about 18 of. I am trying to get 6 to load up at a time with 3 colums and 2 rows ( 3 across top and 2 sets ). And I cant figure it out. Along with that I am trying to get these logos to be centered in the middle of my swf. Here is how I am going about it which loads them irraticaly across.
var numOfItems:Number;
var games:MovieClip = this;
var numOfRows = 2;
var numOfColum = 3;
var showMax = 6;
var spacing = 20;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
////GetEm
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = games.attachMovie("iconMC","iconMC"+i,i+1);
t.placeEm = i * (numOfItems/numOfRows);
t.onEnterFrame = placeEm;
t.logo.logoContainer.loadMovie(nodes*.attributes.logo);
t.t1.tText.text = nodes*.attributes.title;
t.t2.cText.text = nodes*.attributes.category;
t.link = nodes*.attributes.link;
t.onRollOver = over;
t.onRollOut = out;
t.onRelease = released;
}
}
xml.load("icons.xml");
/////placeEm
t._x = centerX;
t._y = centerY; ////////////Here it should set them however it is place them in upper left.
Any ideas?