Delete attachMovie

Hello. I have a function that is attaching something in a column depending on a number I am giving. If I press on that attachment I what to delete that something from the stage.
I have like this:
1
2
3
4
5
6
I press 5 I what to remove 5 from the column.
This is my function. Thank you for any help.
function buildDeleteButtons(k:Number, parentMovie:MovieClip) {
parentMovie._x = 0;
parentMovie._y = 25;
for (var i:Number = 0; i < k; i++) {
var currentDeleteButton:MovieClip = parentMovie.attachMovie(“trashcan”, “myButton” + (i+1), parentMovie.getNextHighestDepth());
currentDeleteButton.id = i;
currentDeleteButton._x = 5;
currentDeleteButton._y = i*(currentDeleteButton._height + 5) + 5;
currentDeleteButton.onRelease = function() {
trace(this.id);
trace(currentDeleteButton);
}
}