Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
Adobe Flex SDK Previous
-
None
-
Affected OS(s): All OS Platforms
Language Found: English
Description
Found in 4.0.0.10872
Steps to reproduce:
1. Compile and run the attached MXML file.
2. Click on the buttons
Actual Results:
The whitespace is getting eaten in the FTETextField making the charAt() return different characters and the words to run together.
Expected Results:
Whitespace logic between the two should be the same.
Workaround (if any):
n/a
<?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/halo"
xmlns:txt="flash.text.*">
<s:controlBarContent>
<s:Button label="5" click="button1_clickHandler(5)" />
<s:Button label="11" click="button1_clickHandler(11)" />
<s:Button label="17" click="button1_clickHandler(17)" />
<s:Button label="31" click="button1_clickHandler(31)" />
</s:controlBarContent>
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.core.*;
import mx.utils.ObjectUtil;
private const tf:TextField = new TextField();
private const fte:FTETextField = new FTETextField();
public const condenseWhiteTxt:String = "<p>The <b>Quick</b> <font color='#FF0000'>Brown</font> <i>Fox</i> <a href='http://adobe.com/'>Jumps</a> <u>Over</u> The Lazy Dog.</p>";
private function init():void
{ var fmt:TextFormat = new TextFormat(); fmt.font = "df4font"; tf.border = true; tf.autoSize = "left"; tf.htmlText = condenseWhiteTxt; can.rawChildren.addChild(tf); ta1.width = tf.width; fte.border = true; fte.autoSize = "left"; fte.htmlText = condenseWhiteTxt; fte.x = tf.width + 10; can.rawChildren.addChild(fte); ta2.width = fte.width; }protected function button1_clickHandler(idx:uint):void
{ ta1.text = "[" + String(tf.text).substring(idx-1, idx+2) + "]\n\n" + ObjectUtil.toString(tf.getTextFormat(idx-1, idx+2)); ta2.text = "[" + String(fte.text).substring(idx-1, idx+2) + "]\n\n" + ObjectUtil.toString(fte.getTextFormat(idx-1, idx+2)); } ]]
>
</fx:Script>
<mx:HBox id="can" x="20" y="20" creationComplete="init();" />
<mx:HBox x="20" y="100">
<mx:TextArea id="ta1" height="300" />
<mx:TextArea id="ta2" height="300" />
</mx:HBox>
</s:Application>