I have an array and I am looping through to get the values randomized. After that I put these values in a MC called ‘container’. Then the containerMC scrolls to the left and eventually goes away. What I am trying to do is, duplicate the containerMC when it gets to a certain _x. I can get the MC to duplicate but what happens is it has the default data that was in there before the loop through random array. And it is not moving at all. Any insite on this? here’s the code. Please disregaurd the messy code…
//name the array
catagories = new Array();
catagories[0] = "Auto";
catagories[1] = "Bath Accessories";
catagories[2] = "Boyds Plush";
catagories[3] = "Candle Accessories";
catagories[4] = "Children's Toys & Gifts";
catagories[5] = "Christmas Ornaments";
catagories[6] = "Collector's Gifts";
catagories[7] = "Crystal";
catagories[8] = "Frames";
catagories[9] = "Home Accessories";
catagories[10] = "Home Fragrance";
catagories[11] = "Inspirational";
catagories[12] = "Jewelry";
catagories[13] = "Jewelry & Music Boxes";
catagories[14] = "Kitchen";
catagories[15] = "Men's & Travel";
catagories[16] = "Novelty Gifts";
catagories[17] = "Office Accessories";
catagories[18] = "Outdoor Accessories";
catagories[19] = "Pet Related Items";
catagories[20] = "Pillows";
catagories[21] = "Plush Animals";
catagories[22] = "Sanrio";
catagories[23] = "Seasonal Décor";
catagories[24] = "Serveware";
catagories[25] = "Teacher";
catagories[26] = "Tween";
catagories[27] = "Wall Décor";
catagories[28] = "Windchimes";
catagories[29] = "Women's Accessories";
catagories[30] = "Women's Clothing";
catagories[31] = "Women's Toiletries";
//***********make a random instance of the array******************
function sortRand () {
if (random(2) == 0) {
return -1;
}
if (random(2) == 0) {
return 1;
}
}
catagories.sort(sortRand);
//*************************************************************
//*****************Basic idea one long movie*******************
var list:String = catagories.join(" ");
trace(list);
container.txtValues.text = list;
container.onEnterFrame = function () {
animate();
};
function animate():Void{
if(container._x == -3700){
//removeMovieClip(this.container);
container._visible = false;
//duplicateMovieClip(container, "container", this.getNextHighestDepth());
container._x = 300;
container._visible = true;
}else{
container._x--;
updateAfterEvent();
}
}
var nInerval:Number = setInterval(animate, 1);
Thanks for your help,
-Nimbusism