Array Help Please? :)

Hi, I’m new to the forums hopefully someone can help me out. I’m not new to flash but new to some heavier concepts of actionscripting. I’m trying to step outside my bounds to grow a little and learn more. I worked on this actionscript with a friend a year ago and to be honest he knew a lot more than me it uses mc tween 2, which I’m familiar with. He moved away so I’m on my own. It’s pretty simple concept this is suppose to just swap out images. I have it set to 3 objects. I was going over things and want to set it up for 5 objects. I thought I knew how to do it to set it up for 5 images but I totally couldn’t get it working. I was wondering if someone could point me in the right direction or show me where I can learn how. I tried just copying and pasting and adjusting the last part of the image 3 part but it looks like I have to define “four” and “five” somehow and not sure how to do so. This is what I have so far. Any help is greatly appreciated. -Mike

 //mctween initiate
#include "mc_tween2.as"
stop();
//mctween start
var picArray:Array = ["one", "two", "three", "four", "five"];
var posArray:Array = [-219, 172, 559];


init = function(){
	//one.xSlideTo(172,.15,"easeOutQuad");
	_root.c_img = 0;
	eval(picArray[_root.c_img]).tween("_x", posArray[1], 0.7, "easeOutExpo");
}

init();

f_btn.onPress = function(){
	  cur_img = _root.c_img;
	if (cur_img == 2){		
			n_img = 0; 
			trace(" one " + n_img);
		} else {			
			n_img = ++cur_img;
			trace(" two " + n_img);
			}
			trace(cur_img);
			trace(" three " + n_img);
				eval(picArray[_root.c_img]).tween("_x", posArray[2], 0.25, "easeOutExpo");
				eval(picArray[n_img])._x = posArray[0];
				eval(picArray[n_img]).tween("_x", posArray[1], 0.7, "easeOutExpo");
				_root.c_img = n_img;
}

b_btn.onPress = function(){
	  cur_img = _root.c_img;
	if (cur_img == 0){		
			n_img = 2; 
			trace(" one " + n_img);
		} else {			
			n_img = --cur_img;
			trace(" two " + n_img);
			}
			trace(cur_img);
			trace(" three " + n_img);
				eval(picArray[_root.c_img]).tween("_x", posArray[0], 0.25, "easeOutExpo");
				eval(picArray[n_img])._x = posArray[2];
				eval(picArray[n_img]).tween("_x", posArray[1], 0.7, "easeOutExpo");
				_root.c_img = n_img;
}

Attached is a zipped fla for reference if that helps. :slight_smile: