5 Replies Latest reply on Jun 22, 2007 7:10 AM by kglad

    Duplicate Movie Clip

    jude86
      Hello!!

      Im really confused, i need help with the duplicate movie clip function, below is my code but i will try and explain it a little for you.
      firstly when the variable 'button7white' is set to 1, then when the script is run first............the variable 'alreadydone7' is set to false and the script is ran through and it all works. But the second time the script is run through, it should go to the 'else if' statement, where i ensure the new duplicated clip is visible, but it doesnt work?! Is there anyway to make the duplicated movie clip, visible and not visible????!!

        • 1. Re: Duplicate Movie Clip
          BarryGee Level 1
          Hi Jude86.

          I havent tested this but give it a try.

          Barry.


          • 2. Re: Duplicate Movie Clip
            jude86 Level 1
            Hello,

            Thank you for the reply....i tried that but unfortunatley it doesnt appear to work, i have looked into the problem further.....and i have found that if i trace '_root.hexSeven_mc' it comes up with the output....'_level0.hexSeven_mc' however if i trace '_root.colorSeven_mc' the output is undefined..........so i think the problem lies with the duplicate movie clip, but i dont know where or how it could have gone wrong?!?!?

            any ideas??

            many thanks for your help!!

            Cheers Jude
            • 3. Re: Duplicate Movie Clip
              kglad Adobe Community Professional & MVP
              i assume that trace(_root.colorSeven_mc) statement does not immediately follow your duplicateMovieClip() statements so you're probably assigning something else to depth 1 in the _root timeline.
              • 4. Re: Duplicate Movie Clip
                jude86 Level 1
                Hello,

                Thanks for your reply, i have adapted my code slightly since this post, and it now states:

                var name7:String = "colorSeven_mc";
                _root.hexSeven_mc.duplicateMovieClip(name7, 1);

                as a result of this the trace is returning what it should be: "_level0.colorSeven_mc"

                So this part of the code is obviously working.

                The next problem i have is that once the code is executed and the new movie clip is displayed as white, the script moves onto the next frame. the code in the next frame makes the newly created movie clips invisible this all works fine. However the script then moves back to the previous frame, (Where the orignial duplicate clip script is) however as a result the duplicated movie clips are not visible? I tried coding it so that they were but this still doesnt work?!

                Sorry if its a bit complicated. any ideas??

                I greatly appreciate your help

                Many thanks
                • 5. Re: Duplicate Movie Clip
                  kglad Adobe Community Professional & MVP
                  if you return to the frame that contains your duplicateMovieClip() code, you're going to remove the movieclip that was created when you previously were in that frame, and create a new movieclip with the same instance name and depth.