7 Replies Latest reply on Apr 23, 2007 6:37 AM by kglad

    Random frame question

    adamlewen Level 1
      Hi again.
      I am trying to solve this:
      I have a movie clip that has three different frames A, B and C,
      with the attached piece of code I was trying to get these frames to show randomly...
      but they pop in order A->B ->C ->A->B->C etc.
      It seems to me that although the randomizer works, it will play all the frames of that movie clip from the beginning regardless of the 'stop();'...
      hope i am clear,
      it seems really simple,

      Thanks!
      (this Q has nothing to do with my previous one... :-)
        • 1. Re: Random frame question
          kglad Adobe Community Professional & MVP
          is there a stop() on the first frame of your movieclip? is there a stop() at the end of each keyframe A,B and C?
          • 2. Re: Random frame question
            adamlewen Level 1
            yes and yes,
            a setInterval(this, "randTile", 500); pops them, and they do, but not randomly at all... they run by order and loop...
            • 3. Re: Random frame question
              kglad Adobe Community Professional & MVP
              you're calling randTile with that setInterval()???? if so, that's a problem mainly because no movieclip (mc) is being passed to randTile.
              • 4. Re: Random frame question
                adamlewen Level 1
                You are right, my bad, I am new to that stuff...
                The code piece above does not effect the code at all...
                So I will rephrase my question, I am using the camera object, that's why the set interval to pop those objects...
                I don't know if you remember (kglad) but you really helped me a couple of weeks ago with that.
                Now I am looking to pop on the screen a random image, I wonder if putting two images on the same time line will work at all...
                • 5. Re: Random frame question
                  kglad Adobe Community Professional & MVP
                  what's the name of the movieclip that has those 3 frame labels? and do you really want those 3 frames to be displayed rapidly, one after the other?
                  • 6. Re: Random frame question
                    adamlewen Level 1
                    The movie clip is for example is 'Tile1' and yes, I am trying to 'pop' a random frame whenever the camera detects a color.
                    I got it to work until I was greedy and tried to manipulate the movie-clip to show random frames within.
                    So the reason for the setInterval is mainly for the camera to 'see' movement.

                    It might be the way I am calling those movie-clips as well, because I am calling more than one 'Tile' movie-clip...
                    I am calling Tile1, Tile2, Tile3 etc...
                    The code attached shows the detection and the formation, I did not attach the way I situate those MCs, because it has nothing to do with the randomization...

                    Thanks again!!!
                    • 7. Re: Random frame question
                      kglad Adobe Community Professional & MVP
                      so, why not place

                      randTile(mc);

                      within your if(findColor==255){}

                      statement?