I’m trying to attach clips based on elements in an array. then when all the clips are attached, i’m using setinterval to have the attached clips slide onto the stage and stop in a row.
for some reason , the name of the dyamically attached clip isn’t tracing in my function (the one with interval set).
any ideas anyone?
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
picArray=new Array("f_06hcfdgs_202helm.jpg", "f_06hcsd_radio.jpg", "f_06hcfdgs_231skistorage.jpg", "f_06hcfdgs_231Ttop.jpg" , "f_06hcsd_257floorstorage.jpg", "f_06hcsd_257head.jpg", "f_06hcsd_257rearseat.jpg", "f_06hcsd_257rubrail.jpg", "f_06hcsd_260entcenter.jpg", "f_06hcsd_260helm.jpg", "f_06hcsd_skistorage.jpg", "f_06hcfdgs_231helm.jpg");
//loop thru clips and attach them all to an empty clip off stage
for(i=0; i<picArray.length; i++){
county._global=i;
trace(picArray*+" at index number: "+i);
item=startPoint.attachMovie("holder", "holder"+i, i);
//is this neccessary?
item._x=startPoint._x;
item._y=startPoint._y;
item.index=i;
}
//vars to use in function to send clips one at a time
counter = 0;
numItems = picArray.length;
trace(numItems);
myInterval = setInterval(slideClip, 150);
//function to repeat to move each clip
function slideClip(){
//create a var to hold the dynamically attached clip name to pass to Tween
cn="holder" + counter;
moveClip=_root.features.startPoint[cn];
trace(moveClip);
moveClip.index=_root.features.startPoint["holder" + counter].index;
trace(moveClip.index+" this is the index from the attached clip");
//tween, slide the clip over to a position calculated by clip width and index
var theSlide:Tween = new Tween(moveClip, "_x", Elastic.easeOut, moveClip._x, moveClip.index*92, 3, true);
if(counter == numItems) clearInterval(myInterval);
else counter++;
}
slideClip();