# Dynamic text in Dynamic MovieClip

**URL:** <https://forum.kirupa.com/t/dynamic-text-in-dynamic-movieclip/304656>\
**Category:** flash\
**Created:** [February 11, 2010, 10:32am UTC](https://forum.kirupa.com/t/dynamic-text-in-dynamic-movieclip/304656 "2010-02-11T10:32:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![h3d0](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@h3d0](https://forum.kirupa.com/u/h3d0)\
**Post date:** [February 11, 2010, 10:32am UTC](https://forum.kirupa.com/t/dynamic-text-in-dynamic-movieclip/304656/1 "2010-02-11T10:32:48Z")

</div>

Greetings everyone!

1. I’ve created a MovieClip and placed a Dynamic Text into this clip. I’ve named the text “text\_txt”;
2. I’ve exported my MovieClip for action script (made it a class) and gave it name “ImageContainer”; And I deleted MovieClip prototype from stage (to create it dynamically later)
3. On main time line in frame 1 I’ve placed code:

```auto
var clip_mc:ImageContainer = new ImageContainer();
clip_mc.name = "myClip";
addChild(clip_mc);

getChildByName("myClip").text_txt.text = "blabla";

```

And it gives me error:

> 1119: Access of possibly undefined property text\_txt through a reference with static type flash.display: DisplayObject.  
> **Question:** Can I create kind of prototype Clip with some fields (like dinamic text) to reference them later? Where is my mistake?

**ADDED:** I’ve found interesting thing: if I turn off the “Strict Mode” in Publish/Flash/AsctionScript3.0 - everything works fine!

\*\*ADDED: \*\*Ha, everything was easy! I should just change one string like this:

```auto
MovieClip(getChildByName("myClip")).text_txt.text = "doh";

```

When I placed MovieClip in the beginning everything works fine with Strict Mode! Problem has been solved 🅱
