Notifications
Clear all
[Closed] ON Event Expression
Jul 19, 2009 9:10 pm
I have been racking my brain over this and I’m sure the answer is pretty simple and I just cant figure it out right now.
I’m making an interface and the current portion I’m working on involves sliders that control objects. I have two sliders that need to be able to do the following:
-Slider1 will follow slider2 when the linking checkbutton1 is enabled
-Slider2 will follow slider1 when the linking checkbutton1 is enabled
-When checkbutton1 is disabled, both sliders will move independently
I can get the sliders to follow each other without the checkbutton, using:
on sld1 changed state do
sld2.value=sld1.value
on sld2 changed state do
sld1.value=sld2.value
but I cannot get it to work with the button
on chk2 changed state do
)
on sld1 changed state do
sld2.value=sld1.value
on sld2 changed state do
sld1.value=sld2.value
)
I know what I've done wrong in the second part but I cannot figure out how to use on events within on events. Any suggestions on how to fix it?
2 Replies
1 Reply
on sld1 changed val do if chk1.state do sld2.value = val
on sld2 changed val do if chk1.state do sld1.value = val
on chk1 changed state do if state do sld2.value = sld1.value