Groups | Blog | Home
all groups > flash actionscript > june 2004 >

flash actionscript : Duplicating a dynamically made movie


decswxaqz
6/14/2004 11:51:34 PM
In one frame of animation (spans 10 frames but is created in frame 1 on layer1)
I've created a movie called final_form.
I've then got to a seperate frame (frame 3 on layer 2) and tried to duplicate
this movie. but it won't duplicate the movie. Even though I can see the
final_form movie on frame 3. This is the code I'm using. (the other movie is on
a layer 100 below this)

_root.createEmptyMovieClip("final_formFront" , 599);
final_formFront.attachMovie("final_form", "final_formFrontMain", 600);
//duplicateMovieClip("final_form", "final_formFront", 600);

//I have just added these to make sure it's not being created over the
final_form movie and turned invisible
final_formFront._x = 100;
final_formFront._visible = true;

duplicateMovie doesn't work either. It's strange because I can still see the
final_form movie on frrame 3 even though it was created on frame 1. Can you
make a copy of a copy?
kglad
6/15/2004 1:42:29 AM
yes, you can duplicate a duplicate movieclip. but not with the code you listed.

first, if you want to use attachMovie, you need a library movieclip with
linkage ID of "final_form". (right click on a movieclip in your library,
click linkage, tick export for actionscript and fill in the linkage ID.)

second, if you use a statement like duplicateMovieClip("final_form",
"final_formFront", 600); you must have instantiated a movieclip with instance
name final_form in order to duplicate it. if you want to duplicate
"final_formFront" use duplicateMovieClip("final_formFront", "final_form", 600);
or better

final_formFront.duplicateMovieClip("final_form",600);
AddThis Social Bookmark Button