Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ppc_michael

Guest
Original poster
Apr 26, 2005
1,498
2
Los Angeles, CA
I have a series of buttons that load different movies into the same FLVPlayback. Instinctively I should be able to write one function that does that, and set it as each button's event handler for MOUSE_UP, passing the function a unique argument for each button.

But how can I pass the function an argument through the event handler? Some sites say this is not possible, is that true?

Right now, as a workaround I have each button calling a separate function, and each separate function calls the universal loading function, passing it the unique argument.

That's fine for hard-coded buttons, but what if I want to dynamically generate buttons, like from an XML file, which is what I plan to do? How would I handle this?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.