I’m trying to improve the way in which i write my code for example:

```
var equations:Array=["one","two","three"];
var activeEquation:String;
activeEquation = equations[random(equations.length)];
function onEnterFrame(){
if(activeEquation==equations[0]){
equationOne();
}
if(activeEquation==equations[1]){
equationTwo();
}
if(activeEquation==equations[2]){
equationThree();
}
}
function equationOne(){
trace("hello from one");
}
function equationTwo(){
trace("hello from two");
}
function equationThree(){
trace("hello from three");
}
```

This is how I would go about randomly calling a function from an array, but ideally I want to learn to do somthing along the lines of this:

```
var equations:Array=[equationOne,equationTwo,equationThree];
function onEnterFrame(){
this.function = equations[random(equations.length)];
}
function equationOne(){
trace("hello from one");
}
function equationTwo(){
trace("hello from two");
}
function equationTwo(){
trace("hello from three");
}
```

I know thats completely wrong but it kind of shows the direction I want to head in. Basically what I’m trying to achieve is some way of calling on functions stored in an array.

I’m not sure where to start looking in flash help so if anyone could point me in the right direction I would greatly appreciate it.

Thanks