duplicate a mc in flash
Out of context: Reply #6
- Started
- Last post
- 11 Responses
- function820
are you attaching the movieclip or is it on the stage when you compile the swf? because swapDepths will only work if you attach the movie.
the way you're doing it is you're dragging the old one, and making a new one stay at the old spot, it did it the oppisite way, where the new one is moveable
also, loose the set property (unless you're in flash 5)
this._x = 22 is the same, but easier to work with
checkout
http://prototype.uncredited.net/…
drag the top box into the lower lighter box
is this the effect needed?
heres that code:
first frame of the movie
depthLevel = 1;
num = 0;
countup=0
mc_orgClp.onPress = function() {
duplicateMovieClip(this, "mc_newClip"+num, depthLevel);
currentClip = _root["mc_newClip"+num]
currentClip.startDrag(true);num++;
depthLevel++;
};
mc_orgClp.onReleaseOutside = function() {
stopDrag()
if (eval(currentClip._droptarget) == _root.targetArea){
currentClip._x = countup+=this._width+10
currentClip._y = 150
}else{
removeMovieClip(currentClip)
}
delete currentClip
};