On Wed, Dec 31, 2008 at 3:12 AM, Andriy Panas <[email protected]> wrote:

>> First of all, getTextField returns an IUITextField, and there's no
>> method called setTextFormat on IUITextField. So you're casting the
>> object to its actual type, UITextField, and then calling the
>> setTextFormat method on it. That's not supported.
>
>   Actually, when applying bold style to the text I am following the
> same approach from standard component <mx:RichTextEditor>, inside
> RichTextEditor.as, line 449 some unknown to me  Flex SDK engineer is
> calling setTextFormat method like that
> textArea.getTextField().setTextFormat  exactly the same way I do  ;)

I think I may know the unknown engineer, but the point is that the
RichTextEditor is using an undocumented API from the framework. The
usual caveats about using undocumented APIs are applicable here. For
what it's worth, the RichTextEditor also has the same problem that
you're running into: it loses its formatting after a call to
StyleManager.loadStyleDeclarations.

Manish

Reply via email to