# TextArea Issues

**URL:** <https://forum.kirupa.com/t/textarea-issues/312309>\
**Category:** flash\
**Created:** [July 30, 2010, 7:29am UTC](https://forum.kirupa.com/t/textarea-issues/312309 "2010-07-30T07:29:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![holborner](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@holborner](https://forum.kirupa.com/u/holborner)\
**Post date:** [July 30, 2010, 7:29am UTC](https://forum.kirupa.com/t/textarea-issues/312309/1 "2010-07-30T07:29:38Z")

</div>

Hello all,  
I’m trying to create TextArea component in an external .as file. For starters I’ve copy the code directly from the [Adobe AS3 reference page](http://help.adobe.com/en_US/ActionScript/3.0_UsingComponentsAS3/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7fa0.html)

```auto

import fl.controls.TextArea; 
 
var aTa:TextArea = new TextArea(); 
 
aTa.move(100,100); 
aTa.setSize(200, 200); 
aTa.condenseWhite = true; 
aTa.htmlText = '<b>Lorem ipsum dolor</b> sit amet, consectetuer adipiscing elit. <u>Vivamus quis nisl vel tortor nonummy vulputate.</u> Quisque sit amet eros sed purus euismod tempor. Morbi tempor. <font color="#FF0000">Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.</font> Curabitur diam. Suspendisse at purus in ipsum volutpat viverra. Nulla pellentesque libero id libero.';  
addChild(aTa);

```

I just keep getting this error when it runs from a .as file.

```auto

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.controls::TextArea/drawLayout()
at fl.controls::TextArea/draw()
at fl.core::UIComponent/callLaterDispatcher()

```

But if I put the same code in the timeline of a new file it seems to work fine.

Is there any class I still need to import when running this from a .as file? Thanks for your help
