# Passing parameters through dynamic function refrencing

**URL:** https://forum.kirupa.com/t/passing-parameters-through-dynamic-function-refrencing/326636
**Category:** flash
**Created:** [January 1, 2012, 9:04pm UTC](https://forum.kirupa.com/t/passing-parameters-through-dynamic-function-refrencing/326636 "2012-01-01T21:04:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![arunforce](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@arunforce](https://forum.kirupa.com/u/arunforce)
#### Post date: [January 1, 2012, 9:04pm UTC](https://forum.kirupa.com/t/passing-parameters-through-dynamic-function-refrencing/326636/1 "2012-01-01T21:04:50Z")

</div>

I’m making a function, and I want to pass it’s handling less restrictively, kinda like jQuery I guess.

```auto

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:

```auto

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?
