# Passing a funciton name as a variable?

**URL:** https://forum.kirupa.com/t/passing-a-funciton-name-as-a-variable/237560
**Category:** Uncategorized
**Created:** [August 31, 2007, 1:33pm UTC](https://forum.kirupa.com/t/passing-a-funciton-name-as-a-variable/237560 "2007-08-31T13:33:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![scruji](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@scruji](https://forum.kirupa.com/u/scruji)
#### Post date: [August 31, 2007, 1:33pm UTC](https://forum.kirupa.com/t/passing-a-funciton-name-as-a-variable/237560/1 "2007-08-31T13:33:50Z")

</div>

Been looking everywhere to find out if there is a way to do this:

btn. **onRelease** =function(){  
[INDENT]nowDoDis(“hello”,fireThis())  
[COLOR=Silver]_//tried to use nowDoDis(“hello”,“fireThis()”)_[/COLOR][/INDENT] }

**function** nowDoDis(param1:String, param2:function??){

\*//want to fire param2

param2  
//or  
this[param2]

////???///////  
\*  
}

**function** fireThis(){  
\*//some actionScript code  
trace(“i hope this works”)

- 

}

Anyone know Of a way to accomplish this without having to use an if/then statement

Arigato.
