1 Reply Latest reply on Nov 11, 2006 6:09 PM by injpix

    Random FlV

    german01 Level 1

      I'm trying to randomly load a set of 10 short videos. I have an instance of FLVplayback on the stage named my_video. Here is the script I used, which loads the first video randomly. However, after the first video finished, no other video is loaded.

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

      var currentVideo =random(9);


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


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

      Thanks for your help.

      Please check my script and suggest ways to make it work.
        • 1. Re: Random FlV
          injpix Level 3
          To answer your first question, you would need to obviously replace this line of code of yours;
          var currentVideo =random(9);

          With perhaps the function that is posted in this webpage;

          And to answer your second question you would need to have this line of code;

          …ideally inside a function. However you would still need an event (mouseclick, onLoad, time, to name just a few) of some kind to call that function.