dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Dynamically generated movie clips disappears automatically

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    6

    Dynamically generated movie clips disappears automatically

    Hi

    I dynamically generate movie clips in a for loop. But at the end of the loop, only the last created movie clip exists. Others simply disppears.

    The code I used is

    Code:
    var newy = 610;
    for (var i = 0; i < 2; i++)
    {
    	duplicateMovieClip(specialDisplay,specialDisplay + i,i);
    			
    	eval(specialDisplay + i)._y = newy + 24.4 * i;
    	eval(specialDisplay + i)._x = 10;
    	eval(specialDisplay + i)._alpha = 100;
    }
    Can any one pls tell what the reason might be...

    Thank you

    regards
    Fadi Yoosuf

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    var newy = 610;
    for (var i = 0; i<2; i++) {
    	duplicateMovieClip(specialDisplay, "specialDisplay"+i, i);
    	eval("specialDisplay"+i)._y = newy+24.4*i;
    	eval("specialDisplay"+i)._x = 10;
    	eval("specialDisplay"+i)._alpha = 100;
    }
    or..
    Code:
    var newy = 610;
    for (var i = 0; i<2; i++) {
    	duplicateMovieClip(specialDisplay, specialDisplay._name+i, i);
    	eval(specialDisplay._name+i)._y = newy+24.4*i;
    	eval(specialDisplay._name+i)._x = 10;
    	eval(specialDisplay._name+i)._alpha = 100;
    }
    Last edited by dawsonk; 03-30-2010 at 05:04 PM.

  3. #3
    Junior Member
    Join Date
    Mar 2010
    Posts
    6
    Thank you.... It was a good help

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