469,325 Members | 1,651 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,325 developers. It's quick & easy.

duplicate Mc

Expand|Select|Wrap|Line Numbers
  1. _root.text_mc.duplicateMovieClip("test",1);
  2. _root.test._x="10";
  3. _root.test._y="10";
  4.  
I have a mc called text_mc Inside is a colored line. There is no instance of this clip, it is in the library. I am trying to generate an instance. The above code seems to not do anything. Is there something i am missing? Eventually i would like to put this in a loop and have:

Expand|Select|Wrap|Line Numbers
  1. duplicate....("test"+i,i);
  2. _root.test+i._x=..... ?????? 
  3.  
I am unsure about the line with the ???? i dont think that would work, is there another way?

Thanks
Nov 4 '07 #1
5 2838
rsdev
149 100+
Expand|Select|Wrap|Line Numbers
  1. _root.text_mc.duplicateMovieClip("test",1);
  2. _root.test._x="10";
  3. _root.test._y="10";
  4.  
I have a mc called text_mc Inside is a colored line. There is no instance of this clip, it is in the library. I am trying to generate an instance. The above code seems to not do anything. Is there something i am missing? Eventually i would like to put this in a loop and have:

Expand|Select|Wrap|Line Numbers
  1. duplicate....("test"+i,i);
  2. _root.test+i._x=..... ?????? 
  3.  
I am unsure about the line with the ???? i dont think that would work, is there another way?

Thanks
Hi Shawn,

FInd text_mc in the library 'right-click' and tick the box that says export for runtime sharing. Then you can access the clip in your AS.

When referencing dynamic names you can use [].

_root["test"+i]._x=....
Nov 5 '07 #2
Did you mean export for actionscript? I have that checked. The other option wanted a url? anyways i posted my file online. Its extremely small and simple. Could someone please check it out and let me know? Thanks

www.jeanneflight.com/xmltest.fla
Nov 6 '07 #3
rsdev
149 100+
Did you mean export for actionscript? I have that checked. The other option wanted a url? anyways i posted my file online. Its extremely small and simple. Could someone please check it out and let me know? Thanks

www.jeanneflight.com/xmltest.fla
Hi Shawn,

Apologies I meant export for actionscript. A little tired when I wrote the reply.

Then the identifier is how you would acees the clip using attachMovie in actionscript. Then you can duplicate the clip.
Nov 7 '07 #4
rsdev
149 100+
Otherwise you can drag the text_mc somewhere off stage and name it. From there you can duplicate the clip.
Nov 7 '07 #5
rsdev
149 100+
Otherwise you can drag the text_mc somewhere off stage and name it. From there you can duplicate the clip.
If you want to change the settings of clip after duplicating try this;

Expand|Select|Wrap|Line Numbers
  1. circle_mc.duplicateMovieClip("circle1_mc", this.getNextHighestDepth(), {_x:20, _y:20});
The curly brackets set init properties. Or;

Expand|Select|Wrap|Line Numbers
  1. var clip = _root.text_mc.duplicateMovieClip("circle1_mc", 10);
  2. with(clip){
  3.   _x = 210;
  4.   _y = 210;
  5. }
Hope this helps!
Nov 7 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Giloosh | last post: by
3 posts views Thread by Mohammed Mazid | last post: by
1 post views Thread by Gary Lundquest | last post: by
7 posts views Thread by ucfcpegirl06 | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.