Matt
09-23-2000, 12:47 PM
I have an array which contains the names of functions (a1() and a2()) and
a function is randomly picked. My problem is that the function name is stored
in a variable (choosescript) and I cannot work out how to run the function.
Here is the script:
function mine() {
var scriptlist = new Array;
var choosescript;
scriptlist[0] = "a1"
scriptlist[1] = "a2"
choosescript = scriptlist[Math.floor(Math.random() * scriptlist.length)];
Any ideas please?
Matt (Matt0220@AOL.com)
a function is randomly picked. My problem is that the function name is stored
in a variable (choosescript) and I cannot work out how to run the function.
Here is the script:
function mine() {
var scriptlist = new Array;
var choosescript;
scriptlist[0] = "a1"
scriptlist[1] = "a2"
choosescript = scriptlist[Math.floor(Math.random() * scriptlist.length)];
Any ideas please?
Matt (Matt0220@AOL.com)