Hi,
I would like to hilite or set the opaque property of a button in a group to true when clicked but set it back to false when a user clicks on another button in the group. Any ideas on how to get this done?
im trying to do something like;
repeat with x = 1 to the number of buttons of group "buttons"
if on mouseup
set the opaque of me to true
else
set the opaque of me to false
end if
end repeat
though this syntax is not right it seems
Selected button in a group
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Selected button in a group
One way to do it is to put in the group script:
Code: Select all
on mouseUp
repeat with i = 1 to the number of buttons of me
if the long id of the target is the long id of button i of me then
set the opaque of button i of me to true
else
set the opaque of button i of me to false
end if
end repeat
end mouseUp
Re: Selected button in a group
Sparkout,
Thanks for the reply, I tried this out but it doesn't seem to work. I placed the code in the group script
Thanks for the reply, I tried this out but it doesn't seem to work. I placed the code in the group script
Re: Selected button in a group
Hi askari,
works for me!
Make sure the buttons do not have a "mouseup" handler of their own!
If you already added some "mouseup" handlers to your button, just add:
as the last line of these handlers!
This way the group's script will also get executed!
Best
Klaus
works for me!
Make sure the buttons do not have a "mouseup" handler of their own!
If you already added some "mouseup" handlers to your button, just add:
Code: Select all
on mouseup
## do your stuff here
## ...
pass mouseup
end mouseup
This way the group's script will also get executed!
Best
Klaus
Re: Selected button in a group
Klaus,
That worked perfectly,
Thanks much
That worked perfectly,
Thanks much