-
duplicateMC and levels
I am trying to load in a bunch of rows into an MC that is not on my _root. Can anyone tell me why, when I export, I don't see 6 rows, when rowNum = 6 (I only see my initial 2)?
My hierarchy is as follows: _root > main > rowN (where N is 1 to rowNum; all of these rowN's exist within main). This code I have on my _root timeline:
Code:
for (i=3; i<rowNum+1; i++) {
// start at row3 since rows 1 & 2 already exist
if (i%2 != 0) {
// if i is an odd number
main.row1.duplicateMovieClip("row"+i, i);
} else {
main.row2.duplicateMovieClip("row"+i, i);
}
setProperty("row"+i, _y, (i*70)-70);
}
Is it that my "main" MC starts out only 2 rows high, and can't be extended after the fact? Thanks for any and all help.
-
try -
Code:
setProperty(main["row"+i], _y, (i*70)-70);
trace(main["row"+i]._y);
-
thanks a_m_d,
this worked great. i had no idea duplicateMovieClip was creating an array.
-
this usage of the array operators
trace(main["row"+i]._y);
concatenates a path, and is similiar to -
trace(main.row4._y);
trace(main.row5._y);
and so on .. ..