xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark"
creationComplete="initApp()">
import flashx.textLayout.elements.*;
private var textFlow:TextFlow = new TextFlow();
private var paragraph1:ParagraphElement = new ParagraphElement();
private var paragraph2:ParagraphElement = new ParagraphElement();
private var span1:SpanElement = new SpanElement();
private var span2:SpanElement = new SpanElement();
private function initApp():void {
span1.text = "This is paragraph one.";
span2.text = "This is paragraph two.";
paragraph1.addChild(span1);
paragraph2.addChild(span2);
textFlow.addChild(paragraph1);
textFlow.addChild(paragraph2);
myRET.textFlow = textFlow;
}
private function changeColors():void {
// Change color of first paragraph.
paragraph1.color = 0xFF00FF;
// Change color of second paragraph.
paragraph2.setStyle("color", 0x00FF00);
}