i’m creating a drag and drop application where users can construct a finished product from smaller subproducts. I’ve got all the drag and drop functionality nailed down. I use duplicateMovieClip to create a duplicate of a separate movieclip when you click on a button on the stage. the new clips are simply children of the _root.
I’d like to have them be children of a movieclip instead as i need to have several states in my movie and would like to be able to come back to this drag/drop state and have the clips/construction still in place.
here’s my basic code that uses duplicateMovieClip:
fourSixButton.cnt=4000;
fourSixButton.onPress=function(){
fourSixClip.duplicateMovieClip("fourSix"+this.cnt, this.cnt);
newClip=_root["fourSix"+this.cnt];
newClip.instanceName=_root["fourSix"+this.cnt];
newClip._x=this._x+19.5;
newClip._y=this._y+37;
newClip.startDrag(false, xBoundsLeft, yBoundsTop, xBoundsRight, yBoundsBot);
newClip.gotoAndStop("enabled");
newClip.enable=true;
newClip.price=this.price;
trace("PRICE: "+this.price);
_global.spinClip=newClip;
trace("newClip: "+newClip);
this.cnt++;
}
if anyone can advise on how to target a movieclip instead of _root, that would be great!