Changing properties

I have this code:


currPos=_root.indicator.indicator;

currPos is a numeric value that I get from _root.indicator.indicator.
This value can be 1, 2, 3 or 4. It is random.

I then have this example if statement:


if (_root.score.notes1.pos==3)
trace(“success”);

I want the numeric “1” from notes1.pos to be dependent on the value of currPos.

That is, if currPos=5, the statement will be:


if (_root.score.notes5.pos==3)
trace(“succcess”);

I tried this:

if (_root.score.notes[currPos].pos==3)
… blah blah

but it does not work.
I know the syntax is wrong but I just can’t figure out the right syntax.

Help please?
Thank you all =D

Howdy…

Try this…

if (_root.score[“notes” + currPos].pos == 3)

thanks cyanblue that worked perfect!:stuck_out_tongue:

You’re very welcome… =)