1 Reply Latest reply on Nov 19, 2006 8:45 PM by kglad

    Random FLV's from Array

    german01
      Hi!
      I' am trying to randomly load 10 short video clips. The script below doesn't work properly. It plays the first video clip randomly, but then nothing else happens. Please answer my questions below.

      script:

      var VideoArray = new Array();
      VideoArray = ["Q1.flv", "Q2.flv", ......"Q10.flv"];

      var currentVideo =random(9);

      my_video.play(VideoArray[currentVideo]);

      var listenerObject:Object = new Object();
      listenerObject.complete = function(eventObject:Object):Void {
      VideoArray = random (9)
      };
      my_video.addEventListener("complete", listenerObject);

      QUESTIONS:

      1. How to randomly load FLV's?
      2. How to make the loaded videos not play automatically?

      Thanks for your help.


      German
      Please check my script and suggest ways to make it work.