2 Replies Latest reply on Apr 17, 2006 10:46 AM by kewlj

    HELP!  need php variables in flash

    kewlj
      The action script below loads two videos ( first.flv, second.flv) then plays them consecutively. I would like to load the videos as variables from a PHP page that this flash is embeded in - something like:

      $first_flv = "first.flv";
      $second_flv = "second.flv";

      How can I get $first_flv and $second_flv into flash variables that can replace the hard-coded ( "first.flv", "second.flv") below?


      //action script

      var videoLoaderIndex:Number = 0;
      var videoPlayerIndex:Number = 0;
      var videoList:Array = new Array( "first.flv", "second.flv");

      vidComp.contentPath = videoList[0];

      function eready(e:Object):Void {
      if( videoLoaderIndex < videoList.length ) {
      videoLoaderIndex++;
      vidComp.activeVideoPlayerIndex = videoLoaderIndex;
      vidComp.load( videoList[videoLoaderIndex] );
      }
      }

      vidComp.addEventListener("ready", eready);
      function ecomplete(e:Object):Void {
      ++videoPlayerIndex;
      if(videoPlayerIndex >= videoList.length) {
      videoPlayerIndex = 0;
      }

      vidComp.activeVideoPlayerIndex = videoPlayerIndex;
      vidComp.visibleVideoPlayerIndex = videoPlayerIndex;
      vidComp.play();
      }

      vidComp.addEventListener("complete", ecomplete );