# Using MovieClip Variables!

**URL:** <https://forum.kirupa.com/t/using-movieclip-variables/137821>\
**Category:** Uncategorized\
**Created:** [February 17, 2005, 5:28pm UTC](https://forum.kirupa.com/t/using-movieclip-variables/137821 "2005-02-17T17:28:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sim085](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Sim085](https://forum.kirupa.com/u/Sim085)\
**Post date:** [February 17, 2005, 5:28pm UTC](https://forum.kirupa.com/t/using-movieclip-variables/137821/1 "2005-02-17T17:28:19Z")

</div>

Why the doesn’t the following code work:

```auto

var m = new MovieClip();
m.createTextField("txt", 1, 20,20, 100, 100);
m["txt"].text = "test";
trace(m["txt"].text);

```

When tracing for the text in the text field it tells me ‘undefined’. I know that if instead I do ‘var m = new MovieClip();’ I do this ‘this.createEmptyMovieClip(“m”, 20);’ it works!

However I can’t do that. I have created a method that is accessed from different movies, and I need to create the movie clip, without adding anything to scene!!

can any one tell me how I could do that?
