Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

duplicate movie clip layer?

Status
Not open for further replies.

wikfx

IS-IT--Management
Dec 16, 2001
196
MT
Hi I have 2 questions,
1: I am trying to use the duplicateMovieClip(); but why does it always show on top of my non duplicated stuff? cant I thrown it to say the bottom layer?
also my other question
2: does the duplicatemovieclip(); command save space or give better runtime speed? because I didnt really see a difference when I used it.

thanks
Brian
 
1. The duplicate comes in at a depth level above the original clip by default - even if you set the depth parameter to a negative number. Anything placed on the stage in the authoring environment doesn't actually have a depth as such so duplicates will come in higher. You can use swapDepths() to swap the duplicate and the original around.

Code:
clip.onRelease = function() {
	this.duplicateMovieClip('newClip', -5, {_x:this._x+10, _y:this._y+10});
	newClip.swapDepths(this);
};

2. Depends what you use it for but essentially it won't make any difference to run speed as opposed to placing copies of the clip on the stage when you're authoring. It will make a slight difference to filesize because code takes up less space than manually copying loads of one clip on the stage.
 
cool thanks for the help wangbar

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top