# Passing parameters to functions from events

**URL:** <https://forum.kirupa.com/t/passing-parameters-to-functions-from-events/255357>\
**Category:** Uncategorized\
**Created:** [March 21, 2008, 3:44pm UTC](https://forum.kirupa.com/t/passing-parameters-to-functions-from-events/255357 "2008-03-21T15:44:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rada](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Rada](https://forum.kirupa.com/u/Rada)\
**Post date:** [March 21, 2008, 3:44pm UTC](https://forum.kirupa.com/t/passing-parameters-to-functions-from-events/255357/1 "2008-03-21T15:44:40Z")

</div>

I’ve read several posts that talk about this. I apologize for creating a new one but my brain requires a category for storing information before i can commit that information to memory. Staring at working coded solutions does not teach me why I’m writing the code.

I do not come from an application development background. I started out as a fine artist and got real good at solving as1/2 problems creatively… I’m bashing my head against the wall trying to understand all the “improvements” in as3.

I’d like to make this as simple as possible. In my head I say, “I want to trace out a different word depending on what button i press” then i say, “ok, well im going to need some buttons, and they are going to call a function and pass the word they are supposed to say”

```auto

//oldschool
btn1.onRelease = function(){
     sayWord("hello")
}
btn2.onRelease = function(){
     sayWord("world")
}
function sayWord(theWord){
     trace(theWord);
}

```

Wow that was super simple. the logic directly correlates to the code i just wrote.

What are the questions I have to ask myself in order to know what is involved in making the same thing in as3?

Thanks guys,  
Rada
