2008-10-16 25 views

回答

2

看來字體,以及文本的其他屬性,其中字幕讀取XML文件中指定(這是從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> 

所以也許部件沒有按你不想讓你壓倒這些?

1

//爲您的FLVPlaybackCaptioning實例創建偵聽器,偵聽文本字段/目標的創建,例如。

myFLVPlybkcap.addEventListener(CaptionTargetEvent.CAPTION_TARGET_CREATED, captionTargetCreatedHandler); 

//然後,當發生這種情況,文本字段的 'defaultTextFormat' 設置爲自己的...

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