Rollouts value changing

Hello!

I am having difficulties with my script and I would really appreciate your help.
In my script, I have 2 Rollouts in a Custom attribute. Let say Rollout rFirst and rSecond.
I would like to be able to change the range of the spinner in the rFirst rollout when I change the value of the rSecond Rollout.

I keep getting undefined. Would any of you know how to get that value?

Thanks in advance for your help! :)

Example of code:
Rollout rFirst "First"
(
spinner test "Width :" range:[10,10000,10] fieldWidth:60
)

Rollout rSecond "Second"
(
spinner LegDistance " Border Distance :" range:[0,10000,0] fieldWidth:35
on LegDistance changed val do
(
test.range = [1,8,2]
)

)

Answer:
I figure out that I just need to declare the two rollout has local variable before creating the rollout.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Swordslayer's picture

Why another variable when you

Why another variable when you can access it directly:

rollout rFirst "First"
(
	spinner test "Width :" range:[10,10000,10] fieldWidth:60
)
 
rollout rSecond "Second"
(
	spinner LegDistance " Border Distance :" range:[0,10000,0] fieldWidth:35
 
	on LegDistance changed val do rFirst.test.range = [0,val,val]
)
 
floater = newRolloutFloater "" 150 200
addRollout rFirst floater
addRollout rSecond floater

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.