I’m making a text editor using Text Area. Which user can change font size, family and etc.
This is my code on as:
private function ChangeFont(event: Event):void
{
var mySelectedTextRange:TextRange = new TextRange(thistxtarea,true,
thistxtarea.selectionBeginIndex,
thistxtarea.selectionEndIndex);
mySelectedTextRange.fontSize = int(cmbbxFntSze.text);
thistxtarea.setFocus();
}
i have this combo box to enter desired font size:
<mx:ComboBox x="78" y="8" width="114" id="cmbbxFntFam" close="ChangeFont(event)"></mx:ComboBox>
How do I change font properties if the text inside is not highlight? For example I position the mouse pointer on last index of text inside my Text Area and I select on my combo box the desired font size. The following font size of letter that inputed in Text Area should be the selected font size on combo box. The code that I post works only if I highlight the desired text.
This is to set the style
This code is use for getting the style from the textArea
Please check for minor errors, coz when i code this i have some commented traces