5 Replies Latest reply on Jun 24, 2010 3:27 PM by Tralthamidor

    Movieclip to loadmovie

    Tralthamidor

      Hello all. I have created a Flash project that uses arrays to populate a 5 x 5 grid on the screen with photos in a movieclip.

       

      - I have it to where it doesn't use the same square twice and

      - each image is randomly selected from the available library clips and doesn't repeat until they are exhausted.

       

      The problem is that I want to have 200 images to choose from. Currently I just have a few movieclips in the library. 200 or more will make the file quite large. I have found that this.attach.movieclip can't pull in .jpgs from outside Flash and that you have to use loadmovie but it doesn't support getNextHighestDepth.

       

      Not sure how to make the transition from one to the other. Or do I have to use both? Docs are sparse on this. If someone could point me to a tutorial or project that deals with this, I would be most appreciative. Thanks. -dr

        • 1. Re: Movieclip to loadmovie
          Ned Murphy Adobe Community Professional & MVP

          If you need to work with depths, you can use the createEmptyMovieClip(instance, depth) method to create a holder to load the image into.

          1 person found this helpful
          • 2. Re: Movieclip to loadmovie
            Tralthamidor Level 1

            Ned> thanks for the response. So are you saying that first I create the loadmovie which pulls in the jpeg from outside and then add a createEmptyMovieClip and where whatever I called the loadmovie goes where you specified the instance?  -dr

            • 3. Re: Movieclip to loadmovie
              Ned Murphy Adobe Community Professional & MVP

              First you create the empty movieclip, putting it at whatever depth you require, then load your image into that movieclip...

               

              this.createEmptyMovieClip("mcName", this.getNextHighestDepth());

              loadMovie("yourImage.jpg", mcName);

              • 4. Re: Movieclip to loadmovie
                Tralthamidor Level 1

                Ned, that helped a lot. Was finally able to load external files. But curiously I have lost the ability to keep my older placed movieclips.

                 

                For example earlier every time I placed a new movieclip on the stage the old one in another location was still there. Now when I use loadMovie it seems to replace the old movieclip. Is there a way to use this and always create a new movieclip? Thanks. -Derryl

                • 5. Re: Movieclip to loadmovie
                  Tralthamidor Level 1

                  So if I use this which pulls from the library to the movieclip, the movie clip is truly duplicated:

                   

                  var newFlyer = this.attachMovie(my_clips [random (5)],"flyer1",this.getNextHighestDepth());

                   

                   

                   

                  but if I use this, the graphic is loaded externally but the old movieclip disappears (or moves to a new place).

                   

                  this.createEmptyMovieClip("flyer1", this.getNextHighestDepth())

                  loadMovie("images/" + r  + ".jpg", flyer1);

                   

                   

                  How do people use the loadMovie function and keep the already created movieclips instead of reusing them?  Thanks. -dr