[Closed] Dynamic rollout problem
I’m working on a script that dynamically creates a rollout of checkboxes. The number of checkboxes will vary according to a selection set.
The core of the problem is dynamically create event listeners to these checkboxes.
This simplyfied code presents the problem:
str = “rollout myRollout “Rollout” (”
str += “group “Checkboxes” (”
str += “checkbox check1 “Checkbox1″” + ” “
str += “checkbox check2 “Checkbox2″” + ” “
str += “)” + ” ” –end group Checkboxes
str += “on check1 changed theChange do print “Check1″” + ” “
str += “on check2 changed theChage do print “Check”” + ” “
str += “)” + ” ” –end rollout MyRollout
execute str
theFloater = newRolloutFloater “RolloutFloater” 500 100
addRollout myRollout theFloater
This code will return the error:
– Error occurred during fileIn in StringStream:”rollout myRollout “Rollout” (group “Checkboxes” (checkbox check1 “Checkbox1” checkbox check2 “Checkbox2” ) on check1 changed theChange do print “Check1” on check2 changed theChage do print “Check” ) “
– Syntax error: at do, expected <rollout clause>
– In line: rollout myRollout “Rollout” (group “Checkboxes” (checkbox check1 “Checkbox1” checkbox check2 “Checkbox2” ) on check1 changed the
[color=white][/color]
You should add
(line break) at the end of each string.
You are producing a single line string and that cannot be evaluated as a rollout.
Also you might take a look at the rollout creator. This utility/class helps you with the dynamic creation of rollouts.
Georg