I’m making a function, and I want to pass it’s handling less restrictively, kinda like jQuery I guess.
function cfunc(min, max)
{
return (Math.floor(Math.random()*(max-min))+min);
}
var cf = "cfunc";
trace(this[cf](0,4));
That code works great, but what I’d like to do is:
function cfunc(min, max)
{
return (Math.floor(Math.random()*(max-min))+min);
}
var cf = "cfunc(0,4)";
trace(this[cf]);
Now I know that alternately, I could pass them individually to the function and then join them all together as one, but I’d prefer to use one variable and pass the data through it, kinda like a scripting engine.
Any suggestions?