Notifications
Clear all

[Closed] Question: Slider / Spinner – Sharing value in UI

Hi people, i can´t solve something that seems to be very simple. I just need the value of the spinner to be related with the value of the slider, so when i change one of the, the other gets the same value on my UI rollout.
Something similar like when i use this ui relationship on an attribute holder in the Parameter section
exampe: parameters ( theValue type:#float ui:(mySlider, mySpinner) )

  Here is the code, how can i do this in a rollout instead in an attribute holder using parameters?

rollout uiR “myRollout”
(
group “myGroup”
(
slider mySlider “” range: [0,100,1] type:#integer across:2
spinner mySpinner ” ” range: [0,100,1] fieldwidth:40 offset: [-100,6] type:#integer
)
)

try (closeRolloutFloater theRollout) catch ()
theRollout = newRolloutFloater “myRollout” 350 100
addRollout uiR theRollout

Thanks, and sorry for my awful english.

3 Replies
rollout uiR "myRollout"
 (
 group "myGroup"
 	(
 	slider mySlider "" range: [0,100,1] type:#integer across:2
 	spinner mySpinner " " range: [0,100,1] fieldwidth:40 offset: [-100,6] type:#integer
 	)
 	
 	--Events
 	on mySlider changed arg do
 	(
 		mySpinner.value = arg
 	)
 	
 		on mySpinner changed arg do
 	(
 		mySlider.value = arg
 	)
 )
 
 try (closeRolloutFloater theRollout) catch ()
 theRollout = newRolloutFloater "myRollout" 350 100
 addRollout uiR theRollout
 

Thank you very Much!!, it works perfectly!!!

You bet. Take a good look at the MaxScript help for spinners/sliders and particularly the events.