1 Reply Latest reply on Dec 21, 2010 7:58 AM by kglad

    Changing the formatting of a TLFTextField declared in Flash Professional.


      I have a TLFTextField created in Flash Professional and I'm attempting to alter it's appearance via code, in Flash Builder.


      I want to retain all formatting rules already applied to the TLFTextField unless I specifically change them, however the following code:

      var format:TextFormat = textField.getTextFormat();
      format.align = TextFormatAlign.RIGHT;
      textField.defaultTextFormat = format;     


      Is producing an error at run-time:

      RangeError: Property lineHeight value -2147483648 is out of range
           at flashx.textLayout.property::Property$/defaultErrorHandler()
           at flashx.textLayout.property::NumberOrPercentProperty/setHelper()
           at flashx.textLayout.formats::TextLayoutFormat/set lineHeight()
           at fl.text::TLFTextField/createTextLayoutFormat()[/Volumes/BuildDrive/Stage/Flash11_Main_485_Stage/main/authortool/Stage/tlfRuntime/fl/text/TLFTextField.as:2244]
           at fl.text::TLFTextField/set defaultTextFormat()[/Volumes/BuildDrive/Stage/Flash11_Main_485_Stage/main/authortool/Stage/tlfRuntime/fl/text/TLFTextField.as:2194]


      Does anyone have any ideas as to how to alter individual formatting properties on a TLFTextField without affecting those already set?