UberPooner
March 18th, 2009, 05:04 AM
Hello, I was wondering how I would be able to add listeners to the stage using a for loop. currently my code looks like this, it is being called when the document opens.
var i:Number;
for(i=1;i<8;i++){
thumbselect.thumb"+i+".addEventListener(MouseEvent.CLICK, images"+i+");
}
That is not working. I tried quoting the whole thing, that did not work. I did trace it like this:
trace(' thumbselect.thumb"+i+".addEventListener(MouseEvent.CLICK, images"+i+")')
and the trace came out with the correct strings.
thanks for your input
var i:Number;
for(i=1;i<8;i++){
thumbselect.thumb"+i+".addEventListener(MouseEvent.CLICK, images"+i+");
}
That is not working. I tried quoting the whole thing, that did not work. I did trace it like this:
trace(' thumbselect.thumb"+i+".addEventListener(MouseEvent.CLICK, images"+i+")')
and the trace came out with the correct strings.
thanks for your input