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).
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));
}
}