RE: [Flashcoders] quick question about buttons

2006-05-02 Thread Ash Warren
You can do this: myButton_btn.onRelease = myButton_btn.onPress = myButton_btn.onRollOver = function(){ doStuff(); } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Burvill Sent: Tuesday, May 02, 2006 11:17 AM To: Flashcoders@chattyfig.figleaf.com

RE: [Flashcoders] quick question about buttons

2006-05-02 Thread Ash Warren
: [Flashcoders] quick question about buttons That's what I'm after. Thanks :o) Ash Warren wrote: You can do this: myButton_btn.onRelease = myButton_btn.onPress = myButton_btn.onRollOver = function(){ doStuff(); } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf

Re: [Flashcoders] quick question about buttons

2006-05-02 Thread ryanm
You can do this: myButton_btn.onRelease = myButton_btn.onPress = myButton_btn.onRollOver = function(){ doStuff(); } In my experience that doesn't work. It *should*, but for some reason, the function never gets assigned to most or all of the events. Better is to use Delegate. import

Re: [Flashcoders] quick question about buttons

2006-05-02 Thread Ian Thomas
Or even: var doStuff:Function=function (){ // code... } myButton_btn.onRelease = doStuff; myButton_btn.onPress = doStuff; myButton_btn.onRollOver = doStuff; or import mx.utils.Delegate; function doStuff(){ // code... } var delDoStuff:Function=Delegate.create(this,doStuff);