for loop - Actionscript 3. Remove loader with a for -


i have loader want remove, , instead of removing 1 one

removechild(imgloader1); removechild(imgloader3); removechild(imgloader4); removechild(imgloader5); removechild(imgloader6); 

i want remove them loop, this

for(i=1; i<=6; i++) {   removechild(imgloader[i]); } 

but not working because isn't uniting imgloader[i] , making imgloader1..2..3

give try:

//define global image loader array going store references var imageloaders:array = [];  var imageloader:imageloader = new imageloader(); var image:urlrequest = new urlrequest("http://server.com/myimage.gif"); imageloader.load(image);  //store reference later use... imageloaders.push(imageloader);  // add stage addchild(imageloader);  // , later remove image loaders stage for(var i:int = 0; < imageloaders.length; i++) {   removechild(imageloaders[i]); } 

hope helps


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -