ScriptSpot

Forum topic · General Scripting

Selecting a name with a value

By alexholmes · 2012-03-20

Description

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 (1)

getnodebyname

jos · 2012-03-20

You can use


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