How would I go about creating a dialog the continuously creates a rollout until the numbered limit is up, or if the user hits Cancel the whole operation is terminated.
fn fnCounter = (
for i = 1 to 4 do
(
global loopCount = i
rollout rlCool ""
(
button btnGo "GO"
button btnCancel "Cancel"
label lbLoopCounter "1"
on rlCool open do
(
lbLoopCounter.text = loopCount as string
)
)
createDialog rlCool 150 150
)
)
clearlistener()
fnCounter()
By
Comments (5)
Comment policy
Thanks guys for the examples I'll go ahead and try these out and see what works best for my situation.
I would want it to progressive execute. Not all at once. So if the user says ok to the first rollout it then creates the second and so forth. but if they hit cancel at any point it just stops.
and if the question is how to abort the process by pressing btnCancel inside your rollouts, then just use global variable:
...and your for-loop w'd become something like:
You can also use two scripts
1) Copy both scripts in your current script folder
2) launch "test0.ms"
3) click "Go" button
4) if you want to cancel, you can hold down the ESC key
Attachments
for i = 1 to 4
[code]
for i = 1 to 4 do
(
rol_Name = "rlCool" + (i as string)
str = "rollout " + rol_Name+ " \"\" ("
str += "button btnGo \"GO\""
str += "button btnCancel \"Cancel\""
str += "label lbLoopCounter \"1\""
str += "on rlCool open do lbLoopCounter.text = loopCount as string"
str += ")"
str += "createDialog " + rol_Name+" 150 150"
execute str
)
clearlistener()
[code]