# List

**URL:** https://forum.kirupa.com/t/list/314451
**Category:** Uncategorized
**Created:** [September 29, 2010, 1:21am UTC](https://forum.kirupa.com/t/list/314451 "2010-09-29T01:21:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![surf](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@surf](https://forum.kirupa.com/u/surf)
#### Post date: [September 29, 2010, 1:21am UTC](https://forum.kirupa.com/t/list/314451/1 "2010-09-29T01:21:34Z")

</div>

Hi,  
I am creating a list such as follows

```auto

var ls:List = new List();
ls.addItem({label:"Apple"});
ls.addItem({label:"Pear"})
ls.addItem({label:"Banana"})
ls.addItem({label:"Grapes"})

addChild(ls);

var btn:Button = new Button();

addChild(btn);

btn.x = 10 + btn.width;
btn.label ="Remove"
btn.addEventListener(MouseEvent.CLICK,onRemoveClick)

function onRemoveClick(e:MouseEvent):void
{
    ls.removeItem(ls.selectedItem);
}

```

what can i do so that when i click the remove button, the console returns trace statement that prints out all the items that werent removed from the list
