# Using an array to go to named frames

**URL:** https://forum.kirupa.com/t/using-an-array-to-go-to-named-frames/332241
**Category:** flash
**Created:** [March 18, 2014, 9:46pm UTC](https://forum.kirupa.com/t/using-an-array-to-go-to-named-frames/332241 "2014-03-18T21:46:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Skarab](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@Skarab](https://forum.kirupa.com/u/Skarab)
#### Post date: [March 18, 2014, 9:46pm UTC](https://forum.kirupa.com/t/using-an-array-to-go-to-named-frames/332241/1 "2014-03-18T21:46:26Z")

</div>

I would like to use an array to send the playhead to named frames. The array is a list of dates, and frames and buttons are named in sync, e.g., button “mar12\_10\_btn” sends the playhead to frame “mar12\_10”.  
This is the code I’ve got:

```auto
date = ["nov16_99", "jan2010", "midjan_10", "feb10_10", "apr10_10", "apr20_10", "may17_10", "may28_10", "jun3_10", "jun11_10", "jun30_10", "jul9_10", "jul20_10", "oct5_10", "oct7_10", "oct20_10", "oct28_10", "nov4_10", "dec6_10", "jan21_11", "feb17_11", "jan12_12", "may15_12", "jun18_12"]

for(i=0; i<date.length; i++){
    var btn:Object = [* + "_btn"];
    btn.onRelease = function(){
        gotoAndStop(*);
    };
};

```

I’ve tried putting quotes inside the gotoAndStop parens, both inside and outside the square brackets. It’s not working, and I’m not getting error messages so I guess the syntax is correct. Suggestions will be welcome!
