RichTextEditor may block setting of styles using setStyle as it expects
the markup to describe the font properties.  This may not be a module
problem.  Try it in a simple test app.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of kaushal_bshah
Sent: Friday, July 25, 2008 12:21 AM
To: [email protected]
Subject: [flexcoders] Re: Loading style sheets at run time

 

Hi 

Let me clear what is MyTextArea. This component is copied from
<mx:RichTextEditor/>, so that user can format each character of
MyTextArea's text. 

For a testing purpose I have create one more component TempTextArea
based on TextArea, and put it inside Card component. And when user
change font I am updating fontFamily of TempTextArea using following
setter method
public function set _font(val:String):void{
this.setStyle("fontFamily",val);
}

And TempTextArea is working correct.

I think there is something wrong in MyTextArea, as it uses all method
of RichTextEditor.mxml and have following function to update styles of
TextArea

public function setTextStyles(type:String, value:Object = null):void
{
//I have removed lines which are not related to my issue
var tf:TextFormat;
var beginIndex:int = this.getTextField().selectionBeginIndex;
var endIndex:int = this.getTextField().selectionEndIndex;
.........
tf[type] = value;
..........
this.getTextField().setTextFormat(tf,beginIndex,endIndex);
}

 

Reply via email to