2008-10-16 5 views

Répondre

2

Il semble que la police, ainsi que les autres propriétés du texte, sont spécifiés dans le fichier XML où les sous-titres sont lus (ce qui est de la documentation):

<?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:fontSize="+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> 

Alors peut-être le composant doesn Tu ne veux pas passer outre?

1

// Créer un écouteur pour votre instance FLVPlaybackCaptioning, en écoutant la création du champ de texte/cible par exemple.

myFLVPlybkcap.addEventListener(CaptionTargetEvent.CAPTION_TARGET_CREATED, captionTargetCreatedHandler); 

// Puis, quand cela se produit, réglez le 'defaultTextFormat' du champ de texte à votre ...

private function captionTargetCreatedHandler(e:CaptionTargetEvent):void{ 
    var myTextFormat:TextFormat = new TextFormat(); 
    myTextFormat.font = "Arial"; 
    myTextFormat.color = 0x00FF00; 
    myTextFormat.size = 18; 
    (e.captionTarget as TextField).defaultTextFormat = myTextFormat; 
} 
Questions connexes