1 Reply Latest reply on Mar 27, 2007 1:33 PM by Blackard84

    Random generater

    RETSUB79
      Hi I wondered if someone could help me, I have a Flash file with 13 different movie clips (each containing there own animation etc) which are each placed within a movie clip called "content_mc" on separate frames. As things stand they play in the order of frames they are on, but I hoping to create some Random actionscript to generate a number between 1 and 13 which will then tell my "content_mc" movie clip to go to that frame number resulting in the 13 different slides playing in a random order.

      If anyone could help or lead me in the right direction that would be great.

      Thanks
        • 1. Re: Random generater
          Blackard84
          Math.round(Math.random()* 13)

          this is what you're looking for... the 13 may not be right, so if it doesn't, just play with that number. I can't remember if it is the actual highest number you want or the number + 1.

          The Math.random gives you a random decimal from 0 to 1, the * 13 gives it to your maximum, and then it's rounded, to give you a whole number.. a frame in your case.

          Hope this helps :)