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.
