Skip navigation
Currently Being Moderated

Caption button won't appear

Jan 24, 2013 10:27 AM

Tags: #component #skin #flvplayback #caption #flvplaybackcaptioning

Hi!

 

I added a FLVPlayback and FLVPlaybackCaptioning on my scene. Each instance are named respectively "display" and "caption".

 

The skin I use is SkinUnderPlaySeekCaption.swf

 

The showCaptions parameter into the FLVPlaybackCaptioning is set to "true".

 

When I publish the file, the play button and the seekbar are there, but not the caption button.

 

Why is it not showing? How can I force it to show?

 

Thank you for your help.

 

Here's the code, in case you might need it :

 

import fl.video.*;

import fl.controls.ProgressBarMode;

 

var flvControl:FLVPlayback = display;

var flvCaption:FLVPlaybackCaptioning = caption;

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

 

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);

 

   pb.setProgress(bl,bt);

}

 

function readyHandler(event:VideoEvent):void{

   removeChild(pb);

   display.play();

}

 

pb.mode = ProgressBarMode.MANUAL;

pb.indeterminate = false;

 

flvControl.addEventListener(VideoProgressEvent.PROGRESS, progressHandler);

flvControl.addEventListener(VideoEvent.READY, readyHandler);

flvControl.source = flvSource;

 
Replies
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Jan 24, 2013 11:25 AM   in reply to JacquesGenevieve

    the source for flvControl should be a timed text xml file, not an flv.

     

    check the help files for how to create that file.

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Jan 24, 2013 12:19 PM   in reply to JacquesGenevieve

    correct, it is an xml.  actually, an xml with a specific (timed text) format:

     

    from the flash help files:

     

    var xml:XML = <?xml version="1.0" encoding="UTF-8"?>

         <tt xml:lang="en" xmlns="http://www.w3.org/2006/04/ttaf1"  xmlns:tts="http://www.w3.org/2006/04/ttaf1#styling">

             <head>

                 <styling>

                     <style id="1" tts:textAlign="right"/>

                     <style id="2" tts:color="transparent"/>

                     <style id="3" style="2" tts:backgroundColor="white"/>

                     <style id="4" style="2 3" tts:fontSize="20"/>

                 </styling>

             </head>

             <body>

                  <div xml:lang="en">

                     <p begin="00:00:00.50" dur="500ms">Four score and twenty years ago</p>

                     <p begin="00:00:02.50"><span tts:fontFamily="monospaceSansSerif,proportionalSerif,TheOther"tts:fon tSize="+2">our forefathers</span> brought forth<br /> on this continent</p>

                     <p begin="00:00:04.40" dur="10s" style="1">a <span tts:fontSize="12 px">new</span> <span tts:fontSize="300%">nation</span></p>

                     <p begin="00:00:06.50" dur="3">conceived in <span tts:fontWeight="bold" tts:color="#ccc333">liberty</span> <span tts:color="#ccc333">and dedicated to</span> the proposition</p>

                     <p begin="00:00:11.50" tts:textAlign="right">that <span tts:fontStyle="italic">all</span> men are created equal.</p>

                     <p begin="15s" style="4">The end.</p>

                 </div>   

             </body>

         </tt>

     

    and the caption button needs to be created and coded by you or, use a skin with a caption button like the skin you said you used, SkinUnderPlaySeekCaption.swf

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Jan 24, 2013 1:04 PM   in reply to JacquesGenevieve

    upload your files to a server and post a link. or, attach a screenshot showing your caption.swf skin with video playing.

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Jan 24, 2013 2:15 PM   in reply to JacquesGenevieve

    i don't see that but i don't have a french flash pro version so, who knows.

     

    anyway, drag a caption button from the component panel, place it where that skin's button should be visible and assign an instance name (eg, cap_btn).

     

    then use:

     

    caption.captionButton=cap_btn;

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 25, 2013 11:48 AM   in reply to kglad

    Yesss! That solved the problem! Thank you!

     

    I still don't know why the button wouldn't show in the first place (since the play button and the seekbar are visible without having to add them individually on the stage). But the good news is that : now it works!

     

    I did have to add a little function to toggle the visibility : obviously. I'll write it down, in case it might be useful to anyone in the future.

     

    ---

     

    cap_btn.addEventListener(MouseEvent.CLICK,onCaptionChange);

     

    function onCaptionChange(e:*):void {

      if (caption.showCaptions){

          caption.showCaptions = false;

         } else {

          caption.showCaptions = true;

         }

    }

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Jan 25, 2013 12:15 PM   in reply to jacquesge

    that's interesting because you should not need that, either.

     

    but, at least, you got it working.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 25, 2013 12:22 PM   in reply to kglad

    Really? Indeed it's strange, because I tried it before adding this function and the button did appear, but I couldn't toggle the visibility of the text. It worked only when I added the function...

     

    It seems I'm not the first one who had this problem : http://forums.adobe.com/thread/796423

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Jan 25, 2013 1:03 PM   in reply to jacquesge

    what cs version are you using and what swf version are you publishing for?

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 25, 2013 1:06 PM   in reply to kglad

    CS4 and 10.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points