for(i=1;i<10;i++){
attachMovieClip("myButton","myButton"+i, i);
}
...
this["myButton"+i].onPress = function() {
myDynamicTextField.text = this.getDepth()+". button was clicked";
trace("Button #"+this.getDepth()+" clicked!");
}
|
Pastie
Support Pastie
or read my
Pastie << self
blog
for(i=1;i<10;i++){
attachMovieClip("myButton","myButton"+i, i);
}
...
this["myButton"+i].onPress = function() {
myDynamicTextField.text = this.getDepth()+". button was clicked";
trace("Button #"+this.getDepth()+" clicked!");
}
|