# Set dynamic text in mc from parent

**URL:** <https://forum.kirupa.com/t/set-dynamic-text-in-mc-from-parent/276312>\
**Category:** flash\
**Created:** [November 25, 2008, 6:33pm UTC](https://forum.kirupa.com/t/set-dynamic-text-in-mc-from-parent/276312 "2008-11-25T18:33:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tpann](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tpann](https://forum.kirupa.com/u/tpann)\
**Post date:** [November 25, 2008, 6:33pm UTC](https://forum.kirupa.com/t/set-dynamic-text-in-mc-from-parent/276312/1 "2008-11-25T18:33:07Z")

</div>

This is probably easy but I’m missing something… I’m trying to assign a text string to a dynamic text field within a movieclip.

In my FLA’s library I have my movie clip “mc” (linkage = MC) and mc has this code in it:

```php
// internal mc code
var tf:TextField = new TextField();
addChild(tf);

```

In Frame 1 I have:

```php
var mc = new MC();
addChild(mc);
mc.tf.text = "here is some text.";

```

This produces the following error:  
[FONT=“Courier New”]TypeError: Error #1009: Cannot access a property or method of a null object reference.[/FONT]

What am I missing?
