Skip to main content
Known Participant
October 8, 2009
Question

Not Getting the OverFlowText

  • October 8, 2009
  • 1 reply
  • 564 views

Hi

     I am creating an application using TextLayout Framework with Flaex 3(SDK 3.4)

     I dont want to wrap the text So I set the LineBreak Property of TextFlow

     textFlow.lineBreak = LineBreak.EXPLICIT;        

     But the Over flow text Is not Visible.

     Here is the code:-

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="OverFlow()">
    <mx:Script>
        <![CDATA[
            import flashx.textLayout.formats.BlockProgression;
            import flash.text.engine.BreakOpportunity;
            import flashx.textLayout.formats.LineBreak;
            import flashx.textLayout.container.DisplayObjectContainerController;
            import flashx.textLayout.elements.SpanElement;
            import flashx.textLayout.elements.ParagraphElement;
            import flashx.textLayout.elements.TextFlow;
            private var textContainer:Sprite;
            public function OverFlow():void{
                textContainer = new Sprite();               
                var textFlow:TextFlow = new TextFlow();
               textFlow.lineBreak = LineBreak.EXPLICIT;               
                var p:ParagraphElement = new ParagraphElement();
                var span:SpanElement = new SpanElement();
                span.text = "123xzasdfasfsdfsdfsdfsdfsdfsd sdf sdfsdfas asd 456 ";
                span.fontSize = 32;
                p.addChild(span);
                textFlow.addChild(p);          
                textFlow.flowComposer.addController(new DisplayObjectContainerController(textContainer,400,100));
                textFlow.flowComposer.updateAllContainers();
                textContainer.graphics.lineStyle(2,0x000000);
                textContainer.graphics.drawRect(0,0,400,100);
                canvas.rawChildren.addChild(textContainer);
            }
        ]]>
    </mx:Script>
    <mx:Canvas id="canvas" x="100" y="20" width="720" height="540"  backgroundColor="#ECE9D8" verticalScrollPolicy="auto" borderColor="#000000"  />
</mx:Application>

Output of the code is as Attached file..

if any body know the solution please Reply.

This topic has been closed for replies.

1 reply

Adobe Employee
October 9, 2009

The text is there, but its getting clipped. Clipping and scrolling are related. You can either do clipping, and scroll to see what's clipped out, or you can turn scrolling off, and let the text overlap the container bounds. When a controller is constructed, by default it allows scrolling. You can turn this off by setting the controller's horizontal *and* vertical scroll policies to "off". This will prevent clipping of the text container. In your example, the text is inside a Flex container, you may have to turn clipping off there as well, unless the Canvas is large enough to fit all the text.

Hope this helps,

- rbin