1 Reply Latest reply on Jun 7, 2006 2:57 AM by DazFaz

    Help with dragging / duplicating MCs

      So I made a simple script that duplicates a MC and gives the mouse x + y coordinates to the MC:

      on (press) {
      boxnumber+=1;
      trace(boxnumber);

      currentbox="box" + boxnumber;

      duplicateMovieClip ("box", "box" + boxnumber, 1);
      setProperty ("box" + boxnumber, _x, _root._xmouse+20);
      setProperty ("box" + boxnumber, _y, _root._ymouse+20);

      _root.currentbox.dragging = true;
      }

      Problem one is that I want a new MC each time the button is pressed, every time I press the last one disappears. ~~~ I tried creating a counter so each instance would be named box1 box2 box 3 etc.

      Problem two is I that want the MC to be dragging the instant it is created. And not have to click down again, why I added this script. ~~~ _root.currentbox.dragging = true;

      but still having problems.

      On top of that. Is this the most efficient way to get an instance of a MC on screen? What I am doing is putting the original MC on the pasteboard so that it is not visible. When someone clicks the button, then the instance appears. And I need it to be so that there can be infinite number of instances if someone keeps pressing.

      But is there a way to create MC instances on a mouse event without having to put one on the pasteboard first?

      Thanks!