View Full Version : Making a Copy
orange_01
03-11-2005, 08:26 PM
Hey guys,
I think my brain is fried at this point and I can't see the obvious. But why does the trace below return "undefined"?
newClip.duplicateMovieClip("oldClip", newClip.getDepth()+1);
trace(oldClip);
removeMovieClip(newClip);
I am trying to make a copy of a movie clip, then delete the original.
Thanks!
_orange
jballou
03-11-2005, 08:44 PM
what is it you want the trace to return? you put in the instance name, not a variable. plus - if your code works, it won't change the appearance of anything. the new mc and the old mc will look exactly a like and be in the same position on the screen.
orange_01
03-11-2005, 08:44 PM
Didn't work :confused:
orange_01
03-11-2005, 08:46 PM
I'm just trying to verify that the duplication succeeded, because the operations after it were not working. By returning "undefined", I know it is not taking place.
jballou
03-11-2005, 08:48 PM
hey man. I just tried it. It worked for me. are you sure you have a mc on the stage with the instance name newClip?
orange_01
03-11-2005, 08:52 PM
Well, yes. But maybe I should have included this in my original post:
newClip =_root.Gallery.createEmptyMovieClip("photo_mc" + _root.Gallery.pIndex, 0);
orange_01
03-11-2005, 08:52 PM
I have a feeling its just putting it somewhere I'm not expecting.
the above code working for me
see what apply to you
Description
Method; creates an instance of the specified movie clip while the SWF file is playing. Duplicated movie clips always start playing at Frame 1, no matter what frame the original movie clip is on when the duplicateMovieClip() method is called. Variables in the parent movie clip are not copied into the duplicate movie clip. Movie clips that have been created using duplicateMovieClip() are not duplicated if you call duplicateMovieClip() on their parent. If the parent movie clip is deleted, the duplicate movie clip is also deleted. If you have loaded a movie clip using MovieClip.loadMovie() or the MovieClipLoader class, the contents of the SWF file are not duplicated. This means that you cannot save bandwidth by loading a JPEG or SWF file and then duplicating the movie clip.
orange_01
03-11-2005, 09:13 PM
Wow, that sucks. So if I remove the newClip, oldClip is removed also?!!?
Any way around this?
orange_01
03-11-2005, 09:15 PM
So this is also saying that if I loaded a jpg into a movie within newClip, adn I duplicate it, it will not keep that jpg inside?
Any suggestions on how to make an exact copy of a movie clip that is on the stage?
the above is out of the MM help (but there is so much rubish in so who knows)
i was testing a bit around and it's seam not to by true that the dublicated are removed on deleting the origin at least i didin't manage this
but that you can't copy loaded stoff is sure oly work around is to load it again (will by in the cache)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.