for (var i:Number = 0; i < 10; i++) { this['button_' + i].onRelease = function():Void { trace('pressed: ' + this._name); } }