how do i implement duplicateMovieClip with this
on (press) {
startDrag(this);
this.swapDepths(100);
}
????
Printable View
how do i implement duplicateMovieClip with this
on (press) {
startDrag(this);
this.swapDepths(100);
}
????
So you're saying you want to make it so then when you click on a symbol, it makes a copy of the symbol and then you're dragging that copied symbol around the stage, right?
If so, try this:
code:
on(press)
{
var nd = _root.getNextHighestDepth();
this.myLastMC = this.duplicateMovieClip('mc_'+nd, nd);
this.myLastMC.startDrag();
}
on(release, releaseOutside)
{
this.myLastMC.stopDrag();
}
One of the potential problems with this method is that the movieclip you are copying inherits the scripts, so all the copied scripts can also be duplicated by clicking on them. If your intent is to make a 'toolbar' which makes 'objects', then this is probably not what you want. In that case, it would be better to use attachMovie (to copy a clip from the library) instead of duplicateMovieClip, so that the scripts don't get copied.