for (i=1; i<=2; i++) { this["alb"+i].i = i; this["alb"+i].onPress = function() { _parent._parent.albom = this.i; }; }