6 Replies Latest reply on Jun 24, 2007 9:16 AM by C-Rock

    Duplicate Movie Clip on another level?

    C-Rock Level 2
      I'm trying to take a movie clip on level 8 of my movie and place a copy in an order form that loads above it on level 10 and i can't get it to work. here is my code? i've tried the bitmapdata too and i can't get it to work either.


      duplicateMovieClip("_level8.designStage", "imageHolder2", 99);

      I'm creating a design app and using masks and the bitmapData will work for printing. I would love to just create a jpeg with the bitmapData class and save it and then reload it in the order form.

      Bottom lilne is I need this movie clip to appear in a higher level exactly the same so I can order it and then put the image in the shopping cart as well.
        • 1. Re: Duplicate Movie Clip on another level?
          kglad Adobe Community Professional & MVP
          you can duplicate your _level8 movieclip (don't use quotes) but it will be in the same _level as the duplicateMovieClip() statement. the 99 refers to the duplicated movieclip's depth.
          • 2. Re: Duplicate Movie Clip on another level?
            C-Rock Level 2
            doesn't work between levels. it works fine on the root, but not between the levels.???

            duplicateMovieClip(_level0.topLine, "imageHolder", 99);
            _root.imageHolder._y = 500;
            • 3. Re: Duplicate Movie Clip on another level?
              Rothrock Level 5
              I think what you are asking for is reparenting – making a duplicate of a movieclip inside a clip/timeline that is different than the original. Under AS1&2 this is not possible. The duplicated clip will always share the same parent as the original.

              Given that even the highest depth on _level8 will never be above even the lowest thing on _level10 (perhaps think of them like floors on a building) you won't be able to do this using duplicateMovieClip().

              Your choices would be:

              redesign the whole thing without using levels and load content into movieclips that can be swapped (best)

              export for actionscript the thing you want and attachMovie in _level10, but _level10 will have to exist (pretty good)

              load another copy of whatever it is that you need into _level10 (okay)

              swapDepths() and put _level8 above _level10 (kludgy, but the one I predict you will go for).
              • 4. Re: Duplicate Movie Clip on another level?
                C-Rock Level 2
                ahhh, i get it, but you predicting that i would choose the last only makes me think you are not away of my skill level. i've just about never had the need for duplicating movie clips very often in my years of programming. removing the levels is not the way to go for the best user experience for sure.

                my clip resides in the right half of the stage and in the center. i cannot use the bitmap data class either because my movie clip is center with it's registration point because it needs to rotate. the bitmap data class will only take the lower right quadrant because of this. so i would love to take a negative value as my xMin in the movie clip and xMax be the postive value and then i would be able to get my image on the level i need it.

                is there a way to enter a range for bitmapData to draw? instead of 300 w and 400 h? that would be the best fix but i don't think it's possible.

                my application is at rgdevelopment1.com and click on design/napkins and see the napkin image created is what i need to take to the order form.

                c
                • 5. Re: Duplicate Movie Clip on another level?
                  Rothrock Level 5
                  it wasn't a slam at your abilities, it just seems that everytime I bring it up that is the choice people go for. Anyways, yes you can move the "window" of the draw using a matrix. You can move, scale, and or rotate it in fact.

                  The code below should point you in the correct direction. But you will still have the problem that if _level10 doesn't exist you won't be able to just attach a bitmap to it. You will need to load content into it first to create it. There is no constructor for _levels!

                  • 6. Re: Duplicate Movie Clip on another level?
                    C-Rock Level 2
                    worked perfect, that's the result i wanted. now i can call this from any level and load the created image into a new movie clip. thanks!