# Can I list functions in an array?

**URL:** https://forum.kirupa.com/t/can-i-list-functions-in-an-array/224625
**Category:** flash
**Created:** [May 3, 2007, 9:02pm UTC](https://forum.kirupa.com/t/can-i-list-functions-in-an-array/224625 "2007-05-03T21:02:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![iphotostuff](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/iphotostuff/32/2368_2.png) [@iphotostuff](https://forum.kirupa.com/u/iphotostuff)
#### Post date: [May 3, 2007, 9:02pm UTC](https://forum.kirupa.com/t/can-i-list-functions-in-an-array/224625/1 "2007-05-03T21:02:19Z")

</div>

Greetings,

I have come across this problem before, but is it possible to build an array that simply has a list of functions in it and then when I call a section of that array functionList[2] it executes the function?

I am building a button that I want to essentially cycle through functions. I know there are other ways around this, like placing each function on a different keyframe and cycling through frames, but that is a little too Flash 5 for me.

I have been able to execute a function inside the array as follows but I really need to be able to do other things when I call the function inside the array:

myFunctionArray=[do\_a\_bunch\_of\_stuff\_1 , do\_a\_bunch\_of\_stuff\_2 , do\_a\_bunch\_of\_stuff\_3];  
bt\_next.onPress = myFunctionArray[2];

I need to be able to do something like:

bt\_next.onPress = function(){  
nextFunction ++  
myFunctionArray[nextFunction]  
}

Is it possible to call functions from an array? Any help would be greatly appreciated. Thanks!

-i
