# Text Layout component: assigning text

**URL:** <https://forum.kirupa.com/t/text-layout-component-assigning-text/323504>\
**Category:** flash\
**Created:** [July 4, 2011, 8:24pm UTC](https://forum.kirupa.com/t/text-layout-component-assigning-text/323504 "2011-07-04T20:24:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pherank](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pherank](https://forum.kirupa.com/u/Pherank)\
**Post date:** [July 4, 2011, 8:24pm UTC](https://forum.kirupa.com/t/text-layout-component-assigning-text/323504/1 "2011-07-04T20:24:21Z")

</div>

I’ve just started messing around with the Text Layout component for CS4. Adobe doesn’t even manage to explain how to assign text to the field (amazing, huh?) in their Help file.

```auto

import flash.display.DisplayObject;
import fl.controls.TextLayout;
/* textLayout_flash is the base class for the Text Layout component. If you bring up the properties on the TextLayout Component in the library, you will see this.*/
var myTextComponent:TextLayout;
// Instantiate the textLayout_flash class to create a TextLayout Component.
myTextComponent = new TextLayout();
// Add the new component to the Stage.
var myTextComponentOnStage:DisplayObject = addChild(myTextComponent);
// Get the Text Flow from the TextLayout Component.
var myTextFlow:Object = myTextComponent.textFlow;
// Change the color of the text to red.
myTextFlow.color = 0xFF0000;

```

How is text imported to the component using AS3?
