Skip to main content
Aaronius9er9er
Inspiring
December 2, 2009
Answered

Caret issues when setting vertical align

  • December 2, 2009
  • 2 replies
  • 793 views

Hey everyone,

I'm just starting to dig into the Text Layout Framework and have noticed a really weird bug.  The test seems really basic so I'm bewildered as to why it would ever be released with the bug in it, so I'm hoping it's just my settings or something.  I'm compiling with the Flex 3.3 SDK and I've included the textLayout.swc in my project.

The bug is essentially this: click in the second line of text and the caret is positioned and sized correctly.  Now click the first line of text and the caret is positioned quite far below both lines of text.  Here's the test:

package {
     import flash.display.Sprite;
    
     import flashx.textLayout.container.ContainerController;
     import flashx.textLayout.conversion.TextConverter;
     import flashx.textLayout.edit.EditManager;
     import flashx.textLayout.elements.TextFlow;
     import flashx.textLayout.formats.VerticalAlign;

     public class FRE3 extends Sprite
     {
          protected var textFlow:TextFlow;
          protected var controller:ContainerController;
          protected var editManager:EditManager;
         
          public function FRE3()
          {
               var markup:XML = <TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><p><span>Hello, World</span></p><p><span>Wo</span><span>ot</span></p></TextFlow>;
               textFlow = TextConverter.importToFlow(markup, TextConverter.TEXT_LAYOUT_FORMAT);
               textFlow.verticalAlign = VerticalAlign.MIDDLE;

               controller = new ContainerController(this, 100, 100);
               textFlow.flowComposer.addController(controller);
               textFlow.flowComposer.updateAllControllers();
              
               editManager = new EditManager();
               textFlow.interactionManager = editManager;
          }
     }
}

This topic has been closed for replies.
Correct answer

I think I'm confused by the terminology.  Do you really mean get the textLayout.swc from Flash Builder 4 or did you mean to say to get it from the Flex 4 SDK?  The only way I know of getting the swc is from the SDK.  The one I'm using I pulled out of the Flex 4 Beta 2 (4.0.0.10485) SDK.  Maybe it was fixed in a nightly builder after that?


Yes, please take the swc from the latest nightly build of the Flex 4 SDK. I tend to confuse myself trying to apply the Flex/Flash Builder name change in too many places, and got it wrong above.

2 replies

December 2, 2009

I can reproduce the problem with your code, but for some reason I can not with our internal test application. Thanks for the report - I'll log a bug.

December 2, 2009

Sorry - Rich is correct. I accidentally had an old version of the Flash Builder SDK targeted when I first tried this out. This has been fixed at some point since the original Flash Builder 4 beta.

Aaronius9er9er
Inspiring
December 2, 2009

Thank you very much for the response!  So by that do you mean I would need to use the latest Flash Builder beta in order to fix the issue?  Currently I'm using Flex Builder 3.0.2.213193

Adobe Employee
December 2, 2009

Didn't repro with the current build.

Richard