Skip to main content
Participant
Jun 30, 2011 9:58 AM UTC
Answered

jumping text issue in RichEditableText


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 is closed to new replies. Start a new post to keep the conversation going.
Jin-HuangCorrect answer
Adobe Employee
Jul 1, 2011 5:59 AM UTC

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

4 replies

Adobe Employee
Jun 30, 2011 10:11 AM UTC

Pls attach the code scrap that can run.

Translate
Participant
Jun 30, 2011 11:44 AM UTC

<?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>

Translate
Jin-HuangCorrect answer
Adobe Employee
Jul 1, 2011 5:59 AM UTC

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

Translate