# Functions random calling

**URL:** <https://forum.kirupa.com/t/functions-random-calling/275939>\
**Category:** Uncategorized\
**Created:** [November 20, 2008, 12:29pm UTC](https://forum.kirupa.com/t/functions-random-calling/275939 "2008-11-20T12:29:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcogiannini](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@marcogiannini](https://forum.kirupa.com/u/marcogiannini)\
**Post date:** [November 20, 2008, 12:29pm UTC](https://forum.kirupa.com/t/functions-random-calling/275939/1 "2008-11-20T12:29:07Z")

</div>

hi all,

I was able to find different threads about random loads: the most are photocontainer, well I also found a text random loader  
But I can’t find some about function random calling: in a site I’m building I have three functions (but other will be added) that when called in callback change general graphic appearance, loading a dozen of different parts in various container with attachMovie; I wish a function that loads them randomly

Actually I’m trying:  
//variable “funArr” with the three function names  
var funArr:Array = new Array(“montaspazio”, “montabilancia”, “montaaereo”);  
//  
//Populating variable “quale” with funArr  
var quale = funArr;

function randomFun() {  
var funQuale = Math.round(Math.random()\*(quale.length-1));  
// using a dynamic text field to control  
testoQuale.htmlText = (quale[funQuale]);  
}  
randomFun();

Now, what I have to do?  
Maybe I need to tie randomFun return to a variable then calling it … how ???  
I need some help, getting lost

thank you all in advance
