# Storing Functions in Arrays

**URL:** <https://forum.kirupa.com/t/storing-functions-in-arrays/248232>\
**Category:** flash\
**Created:** [January 5, 2008, 1:12pm UTC](https://forum.kirupa.com/t/storing-functions-in-arrays/248232 "2008-01-05T13:12:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)\
**Post date:** [January 5, 2008, 1:12pm UTC](https://forum.kirupa.com/t/storing-functions-in-arrays/248232/1 "2008-01-05T13:12:56Z")

</div>

Hello, I am trying to randomly pick out a function and activate it over a time period.

if I store the function names in an array, then randomly select one via a function inside a setInterval, how could I instigate a function call? … have a look:

```auto

var functions:Array = new Array("fade","duplicate","explode");

function fade(){
do this...
}
function explode(){
do that...
}

setInterval(randomCall,1000);

function randomCall(){
var i = Math.floor(Math.random()*3);
function* //// is the function name to call - But How do I activate it now? //////
}

```

I hope this makes sense … Ideas would be appreciated!
