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
>>_______________________________________________
>>[email protected]
>>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
_______________________________________________
[email protected]
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