I'm not sure that's really what I was after... Put simply, I just wanted to be able to call a function from a button action in one line of code without having to add a new "function()" action after the button.
So just this (but sending a param to a function called "doStuff")... my_btn.onRelease = doStuff; Withough having to go: my_btn.onRelease = function(){ doStuff(myParam); } On 9/29/06, Merrill, Jason <[EMAIL PROTECTED]> wrote:
One way: function doStuff(mc){ trace(mc); } my_btn.clip = mc my_btn.onRelease = function(){ doStuff(this.clip); } Might also be a preferred to do with Delegate.create() Jason Merrill Bank of America Learning & Organization Effectiveness - Technology Solutions >>-----Original Message----- >>From: [EMAIL PROTECTED] [mailto:flashcoders- >>[EMAIL PROTECTED] On Behalf Of Mick G >>Sent: Friday, September 29, 2006 2:29 PM >>To: Flashcoders mailing list >>Subject: [Flashcoders] btn action function with params >> >>Just a small thing that I've always wondered... >> >>When you assign a function name to a button action, is there a way to send >>parameters to this function? >> >>eg. >>function doStuff(mc){ >> trace(mc); >>} >> >>//Option1. this is a short way of targeting the above function >>my_btn.onRelease = doStuff; >> >>//Option2. but you can't send parameters >>my_btn.onRelease = doStuff(mc); //does not work >> >>//Option 3. Usually I have to do this... >>my_btn.onRelease = function(){ >> doStuff(mc); //does not work >>} >> >>I know it's no biggie, but it would be nice to do option 2 somehow >> >>- Mick >>_______________________________________________ >>Flashcoders@chattyfig.figleaf.com >>To change your subscription options or search the archive: >>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >>Brought to you by Fig Leaf Software >>Premier Authorized Adobe Consulting and Training >>http://www.figleaf.com >>http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com