2 Replies Latest reply on Apr 24, 2009 5:08 AM by Macnimation

    Flash Video with option to switch subtitles live?

    Macnimation Level 1

      I have a FLash Video (.FLV) and I need to be able to add the option for viewers to switch Subtitle languages on the fly if need be.

       

      Is it possible to use xml files or txt files with the text, and give the control to switch the text during playback?

       

      Cheers

        • 1. Re: Flash Video with option to switch subtitles live?
          RossRitchey Level 4

          What I would do:

           

          Set up the subtitles to work off of an XML file.

           

          Then, add a button to toggle their display, and then, on click, set a boolean value that tells the SWF whether or not the subtitles should be displayed.

           

          (This code is AS3, so would need converted if using AS2 - also, this code is just to give the gist of the technique, not be refined code that can be copy/pasted)

           

          var dispSubs:Boolean = false;

           

          function displaySubtitle():void {

               if(dispSubs){

                    //code to display subtitles

               }

          }

           

          dispSubsBtn.addEventListener(MouseEvent.CLICK,switchBool);

           

          function switchBool(e:MouseEvent):void {

               dispSubs = !dispSubs;

          }

          • 2. Re: Flash Video with option to switch subtitles live?
            Macnimation Level 1

            I'm using CS4 apps, so AS3 is fine. It also seems to be what I need.

             

            I'll play around with it to see if I can work something out.

             

            Cheers