0 Replies Latest reply on Apr 24, 2007 4:32 PM by Kevin_Susman

    flv playback & listener object

    Kevin_Susman
      From a submenu, there are several video options. I am using the flv playback component, with a variable. The user clicks the video, it plays, then a share graphic comes on when the video is done. This works finel.

      BUT, what happens if they don't want to share (toggled on when the clip is complete), and choose instead to watch another vid from the same submenu? The complete function which toggles the alpha for the share button and the stage background thinks the clip is done, so those clips don't go off again. And, the eventListener seems to be overriding the buttons (it's correct for doing so, as the clip is done) I don't think that I can force the alpha channel down. There must be a simple way to test if a new stream has been opened - I am just not sure how to do it. Code is below.

      // background image on
      outtakesMenuGraphic._alpha = 100;
      //vid player off
      my_vidPlayer._alpha = 0;
      //sharing button off
      share_btn._alpha = 0;

      // Listening for when the flv playback is finished. Currently, this tells the background to turn on
      // and the sharing button to turn on.
      var listenerObject:Object = new Object();
      listenerObject.complete = function(eventObject:Object):Void {
      share_btn._alpha = 100;
      outtakesMenuGraphic._alpha = 100;
      my_vidPlayer._alpha = 0;
      share_btn.onRelease = function() {
      gotoAndStop(shareVidsPage);
      }
      };
      my_vidPlayer.addEventListener("complete", listenerObject);

      // the submenu buttons.
      drinks_btn.onRelease=function(){
      vidChoice = "webvids/outtakes/BirdFluOuttakes.flv";
      outtakesMenuGraphic._alpha = 0;
      my_vidPlayer._alpha = 100;
      my_vidPlayer.contentPath = vidChoice;
      };

      harvey_btn.onRelease=function(){
      vidChoice = "webvids/outtakes/HarveyOuttakes.flv";
      outtakesMenuGraphic._alpha = 0;
      my_vidPlayer._alpha = 100;
      my_vidPlayer.contentPath = vidChoice;
      };

      Thanks,
      ks