I’ve got a menu loading from XML data - however I’d like the mc’s to appear sequentially, maybe 1/10th second apart. I know setInterval should do this, but I’m still new to flash and despite trawling Google for 24 hrs solid, nothing seems to show me the right way.
Here’s the script:
function CreatePortMenu(port_xml)
{
var portClients = port_xml.firstChild.childNodes;
var xPos = 0;
var yPos = 0;
var xSpacing:Number = 90;
var ySpacing:Number = 35;
var i = 0;
for ( i = 0; i < portClients.length; i++ )
{
switch (i) //splits the menu items into columns of 4 (max 12 items)
{
case 0:
case 1:
case 2:
case 3:
yPos = ySpacing * i;
break;
case 4:
case 5:
case 6:
case 7:
xPos = xSpacing * 2;
yPos = ySpacing * (i - 4);
break;
case 8:
case 9:
case 10:
case 11:
xPos = xSpacing * 3;
yPos = ySpacing * (i - 8);
}
var currentClient = portClients*;
var portHold = portHolder_mc.attachMovie( "jobOption", "pb"+i, i, {_x:xPos, _y:yPos});
portHold.jobTitle.jobText.text = currentClient.attributes.title;
}
}
So I think I should be inserting two lines, one creating a setInterval, and one clearing it, but where? Some guides say inside the function, some say outside, some say only the clearInterval should be inside, some have the function inside the loop… I also think I’ve tried every possible combination, but no soap. Please help!?