Skip to main content
Participant
June 30, 2011
Answered

jumping text issue in RichEditableText

  • June 30, 2011
  • 1 reply
  • 905 views


Hi,

I am using text layout framework in my application. I am using RichEditableText for editing the text.

txtComp = new RichEditableText();

txtComp.height = 50;

txtComp.setStyle("lineBreak",LineBreak.EXPLICIT);

txtComp.textFlow.fontSize = 50;

txtComp.multiline = true;

So, now the problem is when we go to new line(one line is fine), the text starts jumping because the height is fixed.

This happens in the single line also, i.e. if we set component height to smaller value than font size value.

I am using Flex 4.1

Operating System: Windows XP

This topic has been closed for replies.
Correct answer Jin-Huang

Hi Mayank, what does "jump" mean? I think it runs well on my PC. I'm using Flex SDK 4.5.20135.

1 reply

Adobe Employee
June 30, 2011

Pls attach the code scrap that can run.

Participant
June 30, 2011

<?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"                             xmlns:s="library://ns.adobe.com/flex/spark"                             xmlns:mx="library://ns.adobe.com/flex/mx"                             creationComplete="windowedapplication1_creationCompleteHandler(event)">      <fx:Script>           <![CDATA[                import flashx.textLayout.formats.LineBreak;                import mx.events.FlexEvent;                import spark.components.RichEditableText;                                               private var newTextComponent:RichEditableText;                                          protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void                {                     var tm:TextLineMetrics;                     newTextComponent = new RichEditableText();                     borderContainerID.addElement(newTextComponent);                     newTextComponent.text = "Hello";                     newTextComponent.height = 50                     newTextComponent.setStyle("lineBreak",LineBreak.EXPLICIT);                     newTextComponent.textFlow.fontSize = 70;                     newTextComponent.textFlow.color = 0xFF0000;                     newTextComponent.multiline = true;                }                           ]]>      </fx:Script>      <fx:Declarations>           <!-- Place non-visual elements (e.g., services, value objects) here -->      </fx:Declarations>            <s:BorderContainer id="borderContainerID" backgroundColor="#eeeeee" width="100%" height="70">           <s:layout>                <s:VerticalLayout/>           </s:layout>                </s:BorderContainer> </s:WindowedApplication>

Jin-HuangCorrect answer
Adobe Employee
July 1, 2011

Hi Mayank, what does "jump" mean? I think it runs well on my PC. I'm using Flex SDK 4.5.20135.