Passing arguments in functions (just like starting over)

All I want to do is pass an argument through a function, called by a movie clip. In AS2, it’s this simple:


     [LEFT]grayBtn.[COLOR=#0000ff]onRelease[/COLOR]=[COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
makeItHappen[COLOR=#000000]([/COLOR]someArg[COLOR=#000000])[/COLOR]
[COLOR=#000000]}

lensmanBtn.onRelease=function(){
makeItHappen(anotherArg)
}
[/COLOR]

[/LEFT]

In AS3, I get the whole listener thing. But when you call the function in the listener, you can’t pass the argument!!


     [LEFT]grayBtn.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000080]CLICK[/COLOR], makeItHappen[COLOR=#000000])[/COLOR];
[COLOR=#808080]*//but you can't make it happen- because you can't pass the argument!! *[/COLOR]
 
lensmanBtn.addEventListener(MouseEvent.CLICK, makeItHappen);
//like I said, above

[/LEFT]

So- how can I pass the argument??? I can’t find anything in any tutorial anywhere that answers this question!!!

Thanks to all the smart people who’ve figured this out. :slight_smile:

<rant> :wt: I realize AS3 is the future and the future is now. I’ve been using AS2 for three years, and I’ve learned enough to do some nifty things. But tackling AS3 is almost like starting from the very beginning all over again. Sure, some things transfer easily (for… loops) but some stuff doesn’t. This is one of those things.</rant>