7 Replies Latest reply on Dec 1, 2010 10:02 AM by kglad

    Random images

    Miks000

      Hi all, I have a question and need help

       

      This is basically what i want.

       

      I have a button and onMouseOut I need my flash to load for example
      4 images horizontally, one after another with a sort of a fade in effect (or let's say a simple animation that I desire), BUT
      without repeating the images. Images are brought through a .xml file (max 50 images)

       

      I've added a simple sketch of a Press button and loaded images

       

      Thank You

        • 1. Re: Random images
          kglad Adobe Community Professional & MVP

          take it one step at a time.  what's the first problem you encounter?

          • 2. Re: Random images
            Miks000 Level 1

            First of all, i have made when the button is clicked that random images start to appear

            but one instead of another, and that they can repeat.

             

            I do not want them to repeat; And with loop, I need let's say only 5 of them to appear.

            And they need to appear one after another from right to left. That's what I can't do.

             

            And also, I need a simple animation like fade in when they appear

             

            Thanks!

            • 3. Re: Random images
              kglad Adobe Community Professional & MVP

              copy and paste your code.

              • 4. Re: Random images
                Miks000 Level 1

                I have a pictures.xml code for the pictures

                 

                <xml>
                <images>
                  ......
                </images>
                </xml>

                and then in flash AS2 a movie clip called image_rdm_mc with the code in actions

                 

                xmlImages = new XML();
                xmlImages.onLoad = loadImages;
                xmlImages.load("pictures.xml");

                 

                function loadImages(loaded) {
                if (loaded) {
                xmlFirstChild = this.firstChild;
                imageFileName = [];
                totalImages = xmlFirstChild.childNodes[0].childNodes.length;
                for (i=0; i<totalImages; i++) {
                imageFileName[i] = xmlFirstChild.childNodes[0].childNodes[i].attributes.title;
                }
                      randomImage();
                }
                }
                function randomImage() {
                if (loaded == filesize) {
                var ran = Math.round(Math.random() * (totalImages - 1));
                image_rdm_mc.loadMovie(imageFileName[ran], 1);
                }
                }

                • 5. Re: Random images
                  Miks000 Level 1

                  help

                  • 6. Re: Random images
                    Miks000 Level 1

                    help

                    • 7. Re: Random images
                      kglad Adobe Community Professional & MVP

                      1.  loadMovie() accepts one parameter.   fix that.

                       

                      2.  you're loading one image from that array.  if you want to load more you should encode that.