2 Replies Latest reply on Jan 12, 2007 12:50 AM by Dj_Mario

    Copy multiple movieclips

    Dj_Mario
      I have a movieClip with some other movieClips in it (pictures, text, shapes). And when i press a button it should copy it self and everything in it to a new movieclip. I also want to copy every property and action in it so it will apply to the new movieClip.

      Any easy way to do it?
        • 1. Re: Copy multiple movieclips
          Marghoob Suleman Level 1
          hi DJ Mario...

          You can use duplicateMovieClip and for copying properties you may use this function...
          • 2. Copy multiple movieclips
            Dj_Mario Level 1
            Ok, so i will use the duplicateMovieClip like this

            duplicateMovieClip(_thumbPhoto, "_thumbPhoto2", this.getNextHighestDepth());

            The code works fine that you gave me, but one thing i dind't manage to do. And that is to put the variables to the new movieClip object.

            box_mc.onPress = function() {
            var _properties = copyProperties(this);
            var _thumbPhoto_mc = _thumbPhoto2;
            for(var i in _thumbPhoto_mc) {
            _thumbPhoto_mc ._width = _properties._width;
            // and so one with all the properties.
            }
            }

            but the image that i had loaded in the movieClip isn't there in the new clip, do you know why?

            And one more thing, the action functions wasn't copy eather. onLoad, onPress, onRelease, and so on.. do you know how to copy the as well?

            Thank you for everything