how to: random swf loading

Out of context: Reply #4

  • Started
  • Last post
  • 5 Responses
  • o0o0

    or create an array with your movie names, then choose one of those at random... (check the syntax, I'm doing this from memory)

    var swfArray = new Array("onemovie.swf", "otherone.swf", "thirdone.swf");
    var rnd = Math.round(Math.random()*(swfArr... -1));
    load(swfArray[rnd]);

    the "-1" is because you have 3 elements in your array, but you can't choose swfArray[3], it doesn't exist, only 0,1, and 2 ...

View thread