A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: duplicateMovieClip - newbie question

  1. #1
    Junior Member
    Join Date
    May 2001
    Posts
    1
    I'm working on a little prog with a draggable trailing thing:

    onClipEvent (enterFrame) {
    if (themouseDown == "TRUE") {
    i++;
    newMOV = "drag"+i;
    oldX = _root.drag._x;
    =====>>duplicateMovieClip ("BLUE", newmov+i, i);
    setProperty (newmov, _x, oldX);
    }
    }

    For example, this bit of code is attached to a movieclip instance called RED.
    If my target for duplicatemovieclip is an instance other than red, it doesn't trail. If I put "RED" or "FOO" or _any_ text into the target name, it trails.
    a) why?
    b) can I get RED to trail (make duplicates of) BLUE or can an instance only make duplicates of itself?

    thanks to all

  2. #2
    Senior Member
    Join Date
    Apr 2000
    Location
    Minneapolis
    Posts
    2,127
    You would need to specify the path to the other movieclip. You cant just say "BLUE"

    For instance if red and blue are both movie clips on your maintimeline (_root in flash actionscript) then for the code on red to duplicate blue you need to tell red the path to find blue which would be _root.BLUE.

    so
    duplicateMovieClip ("_root.BLUE", newmov+i, i);

    I didnt really check the rest of your code.

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