I
I
intTosha2016-06-29 23:34:10
Programming
intTosha, 2016-06-29 23:34:10

How to create a copy of a movie clip?

Sbostvenno and the whole question. There is a certain movie clip, and you need to make a copy of it programmatically.
To be more precise: Let
's assume that I have an example.
private function onTabEvent(){
//A graphical object is created here, which is already drawn in the library
var obj = new Sword_mc;
obj.x = 400;
obj.y = 400;
addChild(obj);
obj.addEventListener(MouseEvent.MouseDown,onMouseD);
}
private function onMouseD(e:MouseEvent){
var newObj = e.currentTarget; //This is a reference to the obj object to be used later.
/*
But in this place I need to make an exact copy of newObj;
*/
}
How to do this I have no idea at all. Help me please.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
IceJOKER, 2016-06-29
@IceJOKER

copy/paste

S
Sanostee, 2016-06-30
@andrewpianykh

File.copyTo() ?
help.adobe.com/en_US/FlashPlatform/reference/action...

N
Neonoviiwolf, 2016-06-30
@Neonoviiwolf

Depending on what you mean by a copy of the movie, if directly, then
private var movi1:MovieClip = new MovieClip();
private var movi2:MovieClip = new MovieClip();
now there are 2 instances of the same movie (MovieClip is the name of your movie)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question