Selecting a name with a value

Sorry for the second question today! But I once again have a problem.

I am creating a rollout that has a button that generates x number of objects.
A slider that determines x.
I have this script to name each generated box

 cityBox.name = ("citybox_" + (GenLoop as String) )

So if I generate 50 objects they are named citybox_1 through to 50

Now I want to create annother slider that selects the objects from the sliders value.

Somthing on the lines of

on Slider2 changed val do
(
select $citybox_+(slider2.value)
)

Though I obviously have a very low level of max script and I cant figure it out.

Once again I would really apritiate any help on the subject :)

Cheers

Comments

Comment viewing options

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

getnodebyname

You can use

name = "citybox_" + slider2.value as string
select getnodebyname(name)

Comment viewing options

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