A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Duplicate a movie clip

  1. #1
    Senior Member
    Join Date
    Nov 2004

    resolved [RESOLVED] Duplicate a movie clip

    Hey guys,

    I ran into a problem where I have to duplicate a movie clip on a movie, to make an endless scrolling menu. The problem is I don't know real well how to do it, I can do it fine with graphics but it looks like not possible to do it with mc.

    here's a sample of my code I am trying to attemp

    var refFirst:MovieClip = MovieClip(menuGroup.getChildAt(0));
    var copyFirst:test1 = new test1;
    trace (refFirst.name);
    Any ideas?
    Attached Images Attached Images

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Austin, TX
    In order to create a new movieclip instance with "new whatever()" you need to link it to an actionscript class called whatever. So in your library, right-click test1 and set up the class linkage. Don't worry if it tells you that the class can't be found at that point, as it will create one for you.

    This sort of movieclip creation will create them as they are in the library. It will not duplicate any changes made to the clip at runtime such as added children, transforms, or drawing api.

  3. #3
    Senior Member
    Join Date
    Nov 2004
    Wow. Simple as that. I googled forever for it and always ended up having like a 2 pages of Class file explaining how to do it.

    You sir are my new hero


Tags for this Thread

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