Someone pls help me,
I’m creating a dynamic button with the attach movie method, here’s the code
onClipEvent (load){
thumbnail = 4;
for (i=1;i<=thumbnail;i++){
attachMovie("thumbnail_button", "thumbnail_button"+i, i);
this["thumbnail_button"+i]._y = 0;
this["thumbnail_button"+i]._x = (i-1)*110;
trace(i);
this["thumbnail_button"+i].onRelease = function(){
trace ("button number: " + i + " has been pressed");
}
}
}
It loads the 4 thumbnials correctly, but the buttons all trace the same string, what i mean is all four buttons will trace:
“button number: 5 has been pressed”
instead of:
“button number: 1 has been pressed”
“button number: 2 has been pressed” etc
Can’t seem to figure out what i did wrong, Pls help. Thanks in advance