0 Replies Latest reply on Nov 14, 2006 2:16 AM by jupiter100

    dynamic flv playback

    jupiter100 Level 1
      Hi there
      I've written coding that plays back various flv files.. (using as2, mx2004, Media Playback component)
      I've put two buttons on the stage, each that change a value of a variable to the flv. i.e (video1.flv , video2.flv)
      Then I'm watching the variable change (object.watch) I catch the alteration and then set the player to play the correct movie using setMedia method. Here is the code in the frame.

      var videoWatcher:Function =function(prop , oldVal, newVal)
      {
      myMedaPlayer.setMedia(containit.varq,"FLV");
      return newVal;
      }

      containit.watch("varq", videoWatcher);

      varq is the variable thats gets changed by the buttons and is also watched.
      containit is the mc that contains the variable varq.

      The code all works, but theres a problem. I have to click the button twice for the correct video to play. I think the problem is to do with timing. When the button is pressed for the first time the variable changes, but the player picks up the previous value of the variable.


      I know I could set the buttons to setMedia directly but I don't want to do it this way.. Though I have as a test and the correct video plays first time. So I think it's something to do with timing.

      Hope someone can help with this..

      Here is the published link http://www.plotonline.co.uk/play2/4.html


      I have only one frame in the timeline.