Links loose style when text style has been modified previously
I am making a custom RTE and have a method that inserts a hype link into the text area. I have found that this works fine, except when I have modified the text in someway (i.e font size, wieght etc) then the link style does not appear. The link is there, it is clickable when holding down the ctrl key. Is this a bug, or does anyone have a way of fixing this? Here is some simple code that I get the same wierdness from as well. I just applied the font changes to the textArea in the creation complete, type some text, highlight it and click the button to apply a google.com link, and no blue underline style occurs:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*" creationComplete="onCreationComplete()">
<fx:Script>
<![CDATA[
import flash.text.engine.FontWeight;
import flashx.textLayout.edit.IEditManager;
import flashx.textLayout.formats.TextLayoutFormat;
import mx.events.FlexEvent;
protected function onCreationComplete():void
{
var tf:TextLayoutFormat = blah2.getFormatOfRange(null,0,0);
tf.fontSize = 16;
tf.fontWeight = FontWeight.BOLD;
blah2.setFormatOfRange(tf,0,0);
}
protected function button4_clickHandler(event:MouseEvent):void
{
var editManager:IEditManager = blah2.textFlow.interactionManager as IEditManager;
editManager.applyLink('www.google.com');
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:TextArea id="blah2"/>
<s:Button x="164" y="249" label="Button" click="button4_clickHandler(event)"/>
</s:Application>
