Passing a function around

so, i think it’s just cause it’s the end of the day and my brain wants to quit, but i would like some input.

im trying to pass a function to a question box that when you click the YES button the function passed in will fire for some reason im having a hard time holding the function until the YES is clicked.

here is what i got


//the call that opens the choice box and sets the info the gui_obj part is cause the //funciton is in a separate class file
gui_obj.displayChoice("Add the cell phone to your inventory?", "YES", "NO", gui_obj.addToInventory(item))

//the function to set up everything
public function displayChoice(txt:String, yes:String, no:String, funk:Function)
        {
            panel_choice.txt.text = txt;
            panel_choice.yes.text = yes;
            panel_choice.no.text = no;
            //dtrace(funk+" as "+choiceFunction);
            choiceFunction = Function(funk);
            panel_choice.visible = true;
        }

any creative ideas on how to do this? :insomniac: