all groups > flash actionscript > july 2006 >
You're in the

flash actionscript

group:

Duplicate MC


Duplicate MC DjSickNick
7/31/2006 9:51:32 PM
flash actionscript:
How can I duplicate a movie clip that is already on the stage and set it's x coordinate to 53.8? I know how to do this:
my_mc._x = 53.8;
Re: Duplicate MC Thomas_Bärwinkel
8/1/2006 12:23:20 AM
DjSickNick schrieb:
[quoted text, click to view]
Re: Duplicate MC edos12
8/1/2006 12:33:45 AM
it depends on when u want it done
for example:
if you want it done when you click some where

this.createEmptyMovieClip("canvas_mc",1);
var mouseLisener:Object = new Object();
Mouse.addListener(mouseLisener);
mouseLisener.onMouseDown = function(){

canvas_mc.attachMovie("paulse","paulse_mc",canvas_mc.getNextHighestDepth(),{_x:
_xmouse,_y:_ymouse});
}
Re: Duplicate MC Craig Grummitt
8/1/2006 1:54:43 AM
edos12, that code will attach a movie from the library on mouseclick and place
it at the location of the mouseclick.

for duplicating a movie clip that is already on stage and set its x coordinate
to 53.8 DJSickNick, you can use:

MCtoDuplicate.duplicateMovieClip("newMovieClip",1,{_x:53.8});

where MCtoDuplicate is the movie clip to duplicate, newMovieClip is the
instance name of the new movie clip, and 1 is the depth you want the new movie
clip placed.

for more assistance with this, have a look at the
http://livedocs.macromedia.com/flash/8/main/00002452.html
AddThis Social Bookmark Button