Showing posts with label array. Show all posts
Showing posts with label array. Show all posts

push multiple buttons in array

 var labelArr:Array = new Array();  
 for (i=1;i<50;i++){  
 labelArr.push("button"+i);  
 }  
 for(var i=0; i<labelArr.length; i++)  
 { trace(labelArr[i]);  
 }  

read more : https://github.com/asimkh/projects 
format your code: http://codeformatter.blogspot.ae/

Convert objects in array to MovieClip

/*  convert array objects into movieclip */

    for (var i:uint = 0; i < buttonArray.length ; i++)
    {
        var remov = buttonArray[i];
        var ins:MovieClip = MovieClip(mc.getChildByName(remov));
        ins.gotoAndStop(1);
    }

/*  detecting objects inside container or movieclip */

    for (var i:uint = 0; i < mc.numChildren; i++){
    trace (i+'.\t name:' + mc.getChildAt(i).name +
           '\t type:' + typeof (mc.getChildAt(i))+
           '\t' + mc.getChildAt(i));
    }