1 Reply Latest reply on Jun 6, 2006 1:21 PM by sensesthetic

    [ask] About randoming Scenes

      Hello !

      I am wondering, if it is possible to randomize the order of the scene through actionscript ?

      For example, I have created 3 scenes: sceneA, sceneB, sceneC....when the movie loads, the scenes are loaded randomly...sometimes we would see sceneA, and another time when the user enters the site again, he/she might see sceneB, and another time maybe sceneC or perhaps sceneA...

      Thanks !

      regards,
      Christian
        • 1. Re: [ask] About randoming Scenes
          sensesthetic
          One solution is pretty simple:

          1) Create an array that holds the name of each scene that you want to play.
          2) Generate a random number to specify a point in your array
          3) Load the "scene" with the name appearing at that point in the array.

          You can use this to order your "scenes" as well by incrementing or decrementing the value of your initial random number until you run through all possible values in your array.

          sensesthetic