How do you concatenate variables onto movieclip names

var c = mainSubThumbs.SubThumbsHolder[materialType].subthumb_mc[id]

what i have obviously doesnt work. materialType and id are my variables that I want to be added onto these mc instances…

I would place these movieclips in an array so you can access them like this:


var myArray = new Array(new Movieclip(), new Movieclip());
trace(myArray[1].x);

Also this way allows for you to easily loop thur the arrays.

var c = mainSubThumbs.subThumbsHolder[materialType][“subthumb_mc”][id]

should work fine.

[QUOTE=sekasi;2350992]var c = mainSubThumbs.subThumbsHolder[materialType][“subthumb_mc”][id]

should work fine.[/QUOTE]

I tried your way. and this way:
_global.c = mainSubThumbs.[“SubThumbsHolder”][materialType].[“subthumb_mc”][id];

Im still getting undefined.

what I want is it to be for example mainSubThumbs.SubThumbsHolder0.subthumb_mc5;
Which is the location of of the thumbnail that was clicked.

try

ActionScript Code:
[LEFT][COLOR=#000000]var[/COLOR] c = mainSubThumbs[COLOR=#000000][[/COLOR][COLOR=#ff0000]“SubThumbsHolder”[/COLOR]+materialtype[COLOR=#000000]][/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]“subthumb_mc”[/COLOR]+id[COLOR=#000000]][/COLOR];
[/LEFT]

no this doesnt work either.

createEmptyMovieClip([“subthumb_mc”+id],1)
cheatvariable = [“subthumb_mc”+id]
mainSubThumbs.createEmptyMovieClip(“SubThumbsHolder”+materialType].cheatvariable,1
daft statement but you have to create a so called MC, you can’t declare movie clips like a variable…

ok thanks.

but im trying assign the location of the mc’s to a variable. the movieclips already exist, so wouldnt creating the mc’s again overwite the existing ones?

Maybe there is a different method of doing this?

[quote=geestring;2351427]ok thanks.

but im trying assign the location of the mc’s to a variable. the movieclips already exist, so wouldnt creating the mc’s again overwite the existing ones?

Maybe there is a different method of doing this?[/quote]
The script i gave you does work, i have enclosed example.

Maybe you are trying to reference clips before they exist??

sorry it does indeed work. Another overlooked error somewhere else.

Thanks