[Closed] rollout questions
I have three or above rollouts in a floater , when a rollout is opened I want to the others be closed , how can do that , thanks
Some combination of the ON ROLLEDUP event with the rollout.open property perhaps? Check out the help file, it shouldn’t be too hard to figure out.
I’ve just used this code in a tutorial which may help. this refers to only one rollout but I’m sure it’ll be easy to adapt it
if ((yourrollout != undefined) and (yourrollout.isdisplayed)) do
(
destroyDialog yourrollout
(
destroydialog will actually close the dialog the rollout is in. You’ll want to try something like this (as per Marco):
global test_hello, test_world
rollout test_hello "Test Hello" (
label lbl_hello "Hello"
on test_hello rolledup state do (
test_world.open = not state
)
)
rollout test_world "Test World" (
label lbl_world "World"
on test_world rolledup state do (
test_hello.open = not state
)
)
myFloater = newRolloutFloater "Test" 400 200
addRollout test_hello myFloater
addRollout test_world myFloater rolledup:true
The above is a true toggle – so only one rollout is open at a time and closing one rollout will open the other. If you want it to only ‘close’ the other rollouts when one rollout is opened, check that ‘state == true’ before closing the others.