# Functions in an array

**URL:** <https://forum.kirupa.com/t/functions-in-an-array/222930>\
**Category:** flash\
**Created:** [April 18, 2007, 2:56am UTC](https://forum.kirupa.com/t/functions-in-an-array/222930 "2007-04-18T02:56:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmcnaugh](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rmcnaugh](https://forum.kirupa.com/u/rmcnaugh)\
**Post date:** [April 18, 2007, 2:56am UTC](https://forum.kirupa.com/t/functions-in-an-array/222930/1 "2007-04-18T02:56:17Z")

</div>

hey everyone. I just need a little help with this annoying problem. I have an image that loads into an empty movieclip inside a movieclip.

I have 5 tween functions, in an array that move the movieclip “dummAOutside” when the Movieclips “ArrowBck” and “ArrowFwd” are pressed. When I test the movie it fires all the functions until it goes the last and stops. also the “number” is just a variable I use to help trace the function. Is there a way to get this to work. or if anyone has an easier way to do this let me know. thanks in advance

//the array:  
var featuresArry:Array = [“dummyAMoveLeft”, “dummyAMoveMidd”, “dummyAMoveRight”, “dummyAMoveRightA”, “dummyAMoveRightB”, “dummyAMoveRightC”];  
////  
//the Functions:  
dummyAMoveLeft = function () {  
number = 0;  
trace(number);  
pageNum.txto.text = “PAGE 1”;  
dummAOutside.onEnterFrame = function() {  
new mx.transitions.Tween(this, “\_x”, mx.transitions.easing.Regular.easeOut, this.\_x, 342.0, 30);  
delete this.onEnterFrame;  
};  
};  
dummyAMoveMidd = function () {  
number = 1;  
trace(number);  
pageNum.txto.text = “PAGE 2”;  
dummAOutside.onEnterFrame = function() {  
new mx.transitions.Tween(this, “\_x”, mx.transitions.easing.Regular.easeOut, this.\_x, -36.0, 30);  
delete this.onEnterFrame;  
};  
};  
dummyAMoveRight = function () {  
number = 2;  
trace(number);  
pageNum.txto.text = “PAGE 3”;  
dummAOutside.onEnterFrame = function() {  
new mx.transitions.Tween(this, “\_x”, mx.transitions.easing.Regular.easeOut, this.\_x, -600.0, 30);  
delete this.onEnterFrame;  
};  
};  
dummyAMoveRightA = function () {  
number = 3;  
trace(number);  
pageNum.txto.text = “PAGE 4”;  
dummAOutside.onEnterFrame = function() {  
new mx.transitions.Tween(this, “\_x”, mx.transitions.easing.Regular.easeOut, this.\_x, -1140, 30);  
delete this.onEnterFrame;  
}  
};  
dummyAMoveRightB = function () {  
number = 4;  
trace(number);  
pageNum.txto.text = “PAGE 5”;  
dummAOutside.onEnterFrame = function() {  
new mx.transitions.Tween(this, “\_x”, mx.transitions.easing.Regular.easeOut, this.\_x, -1530.6, 30);  
delete this.onEnterFrame;  
};  
};  
dummyAMoveRightC = function () {  
number = 5;  
trace(number);  
pageNum.txto.text = “PAGE 6”;  
dummAOutside.onEnterFrame = function() {  
new mx.transitions.Tween(this, “\_x”, mx.transitions.easing.Regular.easeOut, this.\_x, -2093.3, 30);  
delete this.onEnterFrame;  
};  
};  
///  
//code for the arrow buttons  
ArrowBck.onPress = function() {  
for (i=0; i\<featuresArry.length; i++) {  
if (i\>=0) {  
featuresArry\*-1;  
trace(featuresArry\*);  
trace(“ArrowBck Press”);  
}  
}  
};  
ArrowFwd.onPress = function() {  
for (i=0; i\<featuresArry.length; i++) {  
if (i\>=0) {  
featuresArry\*+1;  
trace(featuresArry\*);  
trace(“ArrowFwd Press”);  
}  
}  
};
