Adding a clicked button to an Array/Dictionary

Hi,

I got 6 buttons on stage, what i want to do is that when you click a button it checks if the button.name exists in the array/dictionary, if it doesn’t it adds the button to the array/dictionary.

Basically i’d end up with 6 entries in the array/dictionary.

But seeing as i’m struggling to make sense of this, i’d appreciate it if people could nudge me in the right direction.

Thanks