0 Replies Latest reply on Oct 2, 2008 7:38 AM by yogi bear

    random from multiple arrays

    yogi bear Level 1
      I'm trying to generate a random picture half the time from one array and half the time from another array.
      I've get as far as this and it doesn't work. Any help would be useful

      var ranArrays: Array = new Array ("bluePixs", "redPixs");
      var bluePixs:Array = new Array ("bluePix1.swf", "bluePix2.swf", "bluePix3.swf");
      var redPixs:Array = new Array ("redPix1.swf", "redPix2.swf", "redPix3.swf");

      function randomBackground(){
      var randomArray = random (ranArrays.length);
      var randomNumber = random (randomArray.length);
      _root.pix.loadMovie (randomArray[randomNumber]);