7 Replies Latest reply: Jan 31, 2013 10:04 AM by sinious RSS

    AddListener : arrow of the seekbar in FLVPlayback

    jacquesge Community Member



      I had a weird problem with my FLVPlayback : the caption button didn't appear when I was publishing (I did chose a skin with the caption button). The solution was to add manually a caption button (on the already existing skin). I also had to manually add a function to toggle the visibility of the captions.


      Weird, I know. But otherwise, it didn't work.


      So, now I have a new problem. When I click on the seekbar to move further in the video, the captions disappear automatically. Sadly, my variable is still set to "false" (visibility off). So I have to click twice on my caption button to make it appear back.


      I thought that maybe I could add a listener on the seekbar? But it looks like I can't precisely point the seekbar because it's within the skin? How could I do that. Would there be another solution?


      Thank you very much for your time.


      Here's my code...


      import fl.video.*;

      import fl.controls.ProgressBarMode;


      var flvControl:FLVPlayback = display;

      var flvCaption:FLVPlaybackCaptioning = caption;

      var flvSource:String = "videos/P01_Intro.flv";


      flvControl.source = flvSource;

      caption.captionButton = cap_btn;

      caption.source = "intro.xml";


      function progressHandler(event:VideoProgressEvent):void{

         var bl:Number = Math.round(event.bytesLoaded/1000);

         var bt:Number = Math.round(event.bytesTotal/1000);




      function readyHandler(event:VideoEvent):void{





      function onCaptionChange(e:*):void {

                 if (caption.showCaptions){

                     caption.showCaptions = false;

           } else {

                     caption.showCaptions = true;





      function changeStatutCaption(e:*):void{





      // Set progress bar state

      pb.mode = ProgressBarMode.MANUAL;

      pb.indeterminate = false;



      // Add listeners and load the video

      flvControl.addEventListener(VideoProgressEvent.PROGRESS, progressHandler);

      flvControl.addEventListener(VideoEvent.READY, readyHandler);



      trace(flvControl.seekBar) //returns null...