# Choosing elements from array

**URL:** <https://forum.kirupa.com/t/choosing-elements-from-array/328908>\
**Category:** flash\
**Created:** [July 1, 2012, 12:02pm UTC](https://forum.kirupa.com/t/choosing-elements-from-array/328908 "2012-07-01T12:02:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![baldbull](https://avatars.discourse-cdn.com/v4/letter/b/91b2a8/32.png) [@baldbull](https://forum.kirupa.com/u/baldbull)\
**Post date:** [July 1, 2012, 12:02pm UTC](https://forum.kirupa.com/t/choosing-elements-from-array/328908/1 "2012-07-01T12:02:09Z")

</div>

I am trying to pull only certain elements from the array when the user presses a button however I am having some trouble. Here is what I was doing:

```auto
var storeArray:Array = [option1, option2, option3, option4, option5];

if (dynText.text = "buttonPressed") {

var storeArray:Array = [option2, option3, option4];

}

```

Anyway, I thought that was the correct logic and seemed pretty easy but apparently I cannot redefine the array (i believe). I was thinking I could try the splice method but I have like 200 options (even though I only show 5) so I thought that would take quite a while and there had to be an easier way.
