Flash actionscript 3.0: how to put stage objects in array using flash AS 3.0

how to put stage objects in array using flash AS 3.0

Posted by Sankar.G | Posted in | Posted on 10:58 AM

var a:Array=new Array();
var b:Array=new Array();
var c:Array=new Array();
var objec:Array=new Array();
var myarray:Array=new Array();
var i:Number;
var temp:Number;
for(i=0;i<
container.numChildren;i++)
{
objec.push(container.getChildAt(i));
}
for(i=0;i<
objec.length;i++)
{
temp=objec[i].name.slice(1);
myarray[temp]=objec[i];
}
for(i=0;i<
container.numChildren;i++)
{
trace(myarray[i].name);
}

Select all MovieClip which are all you want to put in array and create a new Movie Clip and

name it as container and push that container to array and name the movie clip inside the container in line like a1,a2,a3,a4....... like that and slice the array and store the last number in temp and corrosponding object in that array ......

Comments (0)