# Frame labels in array

**URL:** <https://forum.kirupa.com/t/frame-labels-in-array/298375>\
**Category:** Uncategorized\
**Created:** [October 17, 2009, 3:31pm UTC](https://forum.kirupa.com/t/frame-labels-in-array/298375 "2009-10-17T15:31:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phingko](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@phingko](https://forum.kirupa.com/u/phingko)\
**Post date:** [October 17, 2009, 3:31pm UTC](https://forum.kirupa.com/t/frame-labels-in-array/298375/1 "2009-10-17T15:31:23Z")

</div>

Guys,  
I need help!

I have a movie clip which contains 5 frame labels : one,two,three,four,five  
And I have next and prev button to move around

I have put them in an array and using for loop to call them  
but it jumps straightly to frame label ‘four’ instead of reading one by one.  
I tried to find the problem by using trace (this.currentLabel)  
and apparently, it traced out fine like it works from  
frameLabel"one", “two” to frameLabel “five”

I can’t find what exactly the problem is  
Here’s my code for a clear understanding what I’m trying to say

var instruction\_array:Array=new Array(“one”,“two”,“three”,“four”,“five”);

instruction\_mc.next\_btn.addEventListener(MouseEvent.CLICK, onNext);

function onNext(e:Event):void {  
for(var i:int=0;i\<instruction\_array.length;i++){  
instruction\_mc.gotoAndPlay(instruction\_array\*);  
}  
if(instruction\_mc.currentLabel ==“five”) {  
instruction\_mc.next\_btn.visible = false;  
}

}

Help will be so much appreciated
