# Referencing part of a location

**URL:** <https://forum.kirupa.com/t/referencing-part-of-a-location/319143>\
**Category:** flash\
**Created:** [February 10, 2011, 5:35am UTC](https://forum.kirupa.com/t/referencing-part-of-a-location/319143 "2011-02-10T05:35:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarumitai](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sarumitai](https://forum.kirupa.com/u/sarumitai)\
**Post date:** [February 10, 2011, 5:35am UTC](https://forum.kirupa.com/t/referencing-part-of-a-location/319143/1 "2011-02-10T05:35:29Z")

</div>

How do I reference the “month7” part of this output?

\_level0.box6.month7

I want to say “if that part of the string == month7 then do something”.

I’m duplicating some boxes and attaching some MCs to them and when you click one I want to check if what’s attached is correct. (that’s vague I know, but not entirely relevant).

```auto

for (var i = 0; i < months.length; ++i)
{
 duplicateMovieClip(myButton, "box"+i,i+1);
  var mc = eval("box" + i);
  var cellX = i % 4;
  var cellY = Math.floor(i / 4);
  mc._x = 90 + cellX * 150; //150 = cell width, 90 = left margin
  mc._y = 100 + cellY * 150; //150 = cell height 100 = top margin
  mc.attachMovie(months*[0],months*[0],0);
  mc.onPress = function() {
   trace(this.getInstanceAtDepth(0));
  }
}

```
