9 Replies Latest reply on Dec 3, 2006 4:17 PM by Chris_Pierik

    swf random looping

    Chris_Pierik
      Hi all,

      I am calling a random swf movie out of 11 using the following:

      choice = Math.round(Math.random()*11);
      switch (choice) {
      case 0 :
      loop_mc.loadMovie("loop0.swf");
      break;
      case 1 :
      loop_mc.loadMovie("loop1.swf");
      break;
      case 2 :
      loop_mc.loadMovie("loop2.swf");
      break;
      case 3 :
      loop_mc.loadMovie("loop3.swf");
      break;
      case 4 :
      loop_mc.loadMovie("loop4.swf");
      break;
      case 5 :
      loop_mc.loadMovie("loop5.swf");
      break;
      case 6 :
      loop_mc.loadMovie("loop6.swf");
      break;
      case 7 :
      loop_mc.loadMovie("loop7.swf");
      break;
      case 8 :
      loop_mc.loadMovie("loop8.swf");
      break;
      case 9 :
      loop_mc.loadMovie("loop9.swf");
      break;
      case 10 :
      loop_mc.loadMovie("loop10.swf");
      break;
      }

      loop_mc is just an empty movie clip.

      I'm trying to add a listener that then calls another random swf from the list, but I can't get it to work. Any ideas?