Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling an event handler. Possible?

Status
Not open for further replies.

kempis555

Programmer
Jan 2, 2001
77
Is it possible for one button to call the on(release) of another button?

the code in my button is:

on(release){
_root.other_button.onRelease;
}

Nothing happens though. I'm guessing that the onRelease can only be assigned to, not called.

The only way around this that I see is to pull the code out of other_button's onRelease, put it into a function, and have both buttons call that function. Bleah. I'm too lazy! There's too many buttons to do that to in this project!!!![sad]
 
I'd have thought that putting everything in a function was easier to do, but you can always do this if you're using MX:

button1.onRelease=button2.onRelease=function(){}//etc

The code will have to be centralised somewhere though...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top