Passing parameters to functions from events

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”


//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