frozenpeas
Technical User
Hi,
Everything below works as expected, until the onRelease action is called. The instance names are correct, but the i value within the onRelease comes out as 4 (the length of my array) for every button.
Any ideas? Thank you.
frozenpeas
--
Micfo.com Affiliate Program
Everything below works as expected, until the onRelease action is called. The instance names are correct, but the i value within the onRelease comes out as 4 (the length of my array) for every button.
Any ideas? Thank you.
Code:
for(i=0;i<picArray.length;i++){
//create button on stage
attachMovie("btn","btn"+i,i);
this["btn"+i]._x = originX;
this["btn"+i]._y = originY;
this["btn"+i].txtNum = i+1;
originX += offsetX;
this["btn"+i].onRelease = function(){
trace(i);
trace(this._name);
}
}
frozenpeas
--
Micfo.com Affiliate Program