A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: duplicateMC and levels

Hybrid View

  1. #1
    FK M.D. pheck's Avatar
    Join Date
    Jul 2001
    Location
    MN
    Posts
    807

    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.

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try -
    Code:
    setProperty(main["row"+i], _y, (i*70)-70);
    trace(main["row"+i]._y);

  3. #3
    FK M.D. pheck's Avatar
    Join Date
    Jul 2001
    Location
    MN
    Posts
    807
    thanks a_m_d,

    this worked great. i had no idea duplicateMovieClip was creating an array.

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    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 .. ..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center