Be a Supporter!

Duplicate Movieclip Nested Property

  • 287 Views
  • 1 Reply
New Topic Respond to this Topic
AIDSMcGuff
AIDSMcGuff
  • Member since: Feb. 26, 2006
  • Offline.
Forum Stats
Member
Level 33
Game Developer
Duplicate Movieclip Nested Property 2011-03-19 16:41:00 Reply

I am duplicating a movieclip within a movieclip.

_root.Ground.duplicateMovieClip("ground","dirt"+_root.damt,100);

It duplicates fine, however when I try to set a property of it it doesn't work. I tried these without them working.

_root[Ground["dirt"+_root.damt]]._x = 100;
_root.Ground["dirt"+_root.damt]._x = 100;

Any help would be appreciated, or any link to how the _root[] works because I couldn't find an explanation for it.


01000100011000010110111001100011011 01001011011100110011101010000011010 01011011100110010101100001011100000 11100000110110001100101010001110111 010101111001

BBS Signature
scearezt
scearezt
  • Member since: Aug. 23, 2009
  • Offline.
Forum Stats
Member
Level 16
Programmer
Response to Duplicate Movieclip Nested Property 2011-03-20 09:45:11 Reply

At 3/19/11 04:41 PM, salted-tator-tot wrote: I am duplicating a movieclip within a movieclip.

_root.Ground.duplicateMovieClip("ground"

,"dirt"+_root.damt,100);


It duplicates fine, however when I try to set a property of it it doesn't work. I tried these without them working.

_root[Ground["dirt"+_root.damt]]._x = 100;
_root.Ground["dirt"+_root.damt]._x = 100;

Any help would be appreciated, or any link to how the _root[] works because I couldn't find an explanation for it.

Hey, why are you set the position of the duplication after duplicated? Duplicate to the position.

ground.dirt.duplicateMovieClip("dirt"+_root.damt,1000+_root.damt,{_x:100,_y:100,somevariable:somevalue})

voila, and it's gonna duplicate it at the xy position.. otherwise at 0x0y.


"Stand up and fight! Stand up and see the sky turn bright! Fight for a better day!"
-Turisas