2013-09-03 2 views
0

Пожалуйста, помогите - несмотря на множество небольших изменений - результат всегда один и тот же - без текста.Текстовое поле отображает только белый квадрат

package 
{ 
    import flash.display.Bitmap; 
    import flash.display.Sprite; 
    import flash.events.*; 
    import flash.ui.Keyboard; 
    import board; 
    import flash.accessibility.AccessibilityImplementation; 
    import flash.display.Bitmap; 
    import flash.display.MovieClip; 
    import flash.text.TextField; 
    import flash.text.TextFormat; 
    import flash.display.Sprite; 
    import flash.utils.ByteArray; 
    import flash.events.MouseEvent; 
    import flash.text.AntiAliasType; 
    import flash.utils.describeType; 
    /** 
    * ... 
    * @author Michael 
    */ 

    public class Main extends Sprite 
    {  
     [Embed(source = "C:/Windows/Fonts/Verdana.ttf", fontName = "Verdana", fontWeight = "bold", advancedAntiAliasing = "true", mimeType = "application/x-font")] 
     public static const VERD:Class; 
      /*[Embed(source="../lib/StartText.txt",mimeType="application/octet-stream")] 
      private var myFile:Class; 
      public var b:ByteArray = new myFile(); 
      public var s:String = b.readUTFBytes(b.length) 

     */ 


     public function Main():void 
     { 
      if (stage) init(); 
      else addEventListener(Event.ADDED_TO_STAGE, init); 
     } 

     private function init():void 
     { 
      removeEventListener(Event.ADDED_TO_STAGE, init); 

      var board1:Sprite = new board(); 
      stage.addChild(board1); 



      var myTextBox:TextField = new TextField(); 

      myTextBox.text = "Jabble. Click to Scroll Down . Instructions alternate between English and Japanese (translations). Press H for the help web page or put http://wp.me/P3FUQl-n in your web browser. Beneath is the Board and to the right is the Box where further instruction display as ~-~ which means Press or use mouse to ~ to do ~. Click and Drag Tiles to move it and double click it set it on a square space on the Board or Box and click on the Box to change its mode. Jabble-" ; 
      //(下にスクロールする]をクリック) 英語と日本語(訳)との間で交互に指示。を押して、ヘルプWebページのHまたはWebブラウザでhttp://wp.me/P3FUQl-nを置く。下には、取締役会であり、右に?などのさらなる命令ディスプレイボックスです - ?そのプレスを意味するか、やって?にマウスを使用して?。クリックして、それを移動するにはタイルをドラッグし、ダブル会またはボックス上の正方形のスペースには、それを設定してクリックし、そのモードを変更するには、ボックスをクリックしてください 
      myTextBox.x=32; 
      myTextBox.y=32; 
      myTextBox.width = 32*13; 
      myTextBox.height = 32*13; 
      myTextBox.multiline = true; 
      myTextBox.wordWrap = true; 
      myTextBox.background = true; 
      myTextBox.border = true; 

      var format:TextFormat = new TextFormat("VERD",20); 


      format.font = "Verdana"; 

      format.color = 0xFF0000; 
      format.size = 20; 

      myTextBox.defaultTextFormat = format; 
      myTextBox.embedFonts = true; 
      myTextBox.antiAliasType = AntiAliasType.ADVANCED; 
      stage.addChild(myTextBox); 
      //myTextBox.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownScroll); 
          // 
      //function mouseDownScroll(event:MouseEvent):void 
     //{ 
      //myTextBox.scrollV++; 
     //}   
     // 
      // 
      // 
      //stage.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown); 
      //function myKeyDown(e:KeyboardEvent):void{ 
      //if (e.keyCode ==Keyboard.SPACE) 
      //{ 
      //removeChild(myTextBox); 
      //myTextBox = null; 
      // 
      } 



} 

     }  

ответ

0

Попробуйте добавить setTextFormat

var format:TextFormat = new TextFormat("Verdana",20); 

format.color = 0xFF0000; 
format.size = 20; 

myTextBox.defaultTextFormat = format; 
myTextBox.setTextFormat(format); 
myTextBox.embedFonts = true; 
+0

myTextBox.embedFonts = true; - пробная версия и ошибка показывают, что проблема заключается в этой строке - она ​​также не похожа на opaquebackground и background. Так много для помощи в учебниках - мне было предложено включить эту строку embedFont. – user2617804

0

установка

myTextBox.textColor = 0xFF0000; 
+0

Спасибо за ваш reply- нет никакой разницы попробовать. – user2617804

+0

Я попытался добавить это, и все, что он сделал, это сделать верхнюю строку и левую строку границы поля текста синим. myTextBox.opaqueBackground = 0x0000FF; // синий фон – user2617804

Смежные вопросы