# Access to a textfield in a movieclip on different frames

**URL:** <https://forum.kirupa.com/t/access-to-a-textfield-in-a-movieclip-on-different-frames/292750>\
**Category:** flash\
**Created:** [July 18, 2009, 9:40am UTC](https://forum.kirupa.com/t/access-to-a-textfield-in-a-movieclip-on-different-frames/292750 "2009-07-18T09:40:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hannes](https://avatars.discourse-cdn.com/v4/letter/h/f0a364/32.png) [@Hannes](https://forum.kirupa.com/u/Hannes)\
**Post date:** [July 18, 2009, 9:40am UTC](https://forum.kirupa.com/t/access-to-a-textfield-in-a-movieclip-on-different-frames/292750/1 "2009-07-18T09:40:13Z")

</div>

1, Seems like a standard job, but somehow this doesnt work:  
Movieclip called “Button” lies in the library.  
I instantiate it in code:

```auto
var button:MovieClip = new Button();

```

I have a dynamic textfield with an instance name of “description\_text” in it, but if I try to access it (e.g: change the text), I get an error. This is how I do it:

```auto
(button.getChildByName("description_text")as TextField).text = "Success";

```

> Cannot access a property or method of a null object reference.  
> Why is this not working?  
> 2, I know it’s easier to just have the movieclip invisible on all frames except the ones that I need it. I’m just curious if its possible at all to selectively choose single frames and access their content.
