# AttachMovie and dynamic text with variable

**URL:** https://forum.kirupa.com/t/attachmovie-and-dynamic-text-with-variable/245494
**Category:** flash
**Created:** [November 30, 2007, 7:07am UTC](https://forum.kirupa.com/t/attachmovie-and-dynamic-text-with-variable/245494 "2007-11-30T07:07:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gattu\_marrudu](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gattu\_marrudu](https://forum.kirupa.com/u/gattu_marrudu)
#### Post date: [November 30, 2007, 7:07am UTC](https://forum.kirupa.com/t/attachmovie-and-dynamic-text-with-variable/245494/1 "2007-11-30T07:07:19Z")

</div>

Ok, I’m stuck on a very simple problem.  
I want to access a dynamic text field inside a movie clip, that I created using a variable as a name.

I have a movie clip whose instance name is cc\_mc and a dynamic text field inside it, called textF.

THIS works:

```auto
var mname= "cc_mc"
this.attachMovie("cc", "cc_mc", this.getNextHighestDepth()); 
this.cc_mc.textF.text = "EEEEEEEEEEEEEEEEEEEEEEK"; 

```

(not the first line is redundant here)

THIS does not work: I cannot change the text field content.

```auto
var mname= "cc_mc"
this.attachMovie("cc", "cc_mc", this.getNextHighestDepth()); 
this.mname.textF.text = "EEEEEEEEEEEEEEEEEEEEEEK"; 

```

THIS  
does not work either:

```auto
var mname= "cc_mc"
this.attachMovie("cc", "cc_mc", this.getNextHighestDepth()); 
this["mname"].textF.text = "EEEEEEEEEEEEEEEEEEEEEEK"; 

```

What is wrong with it?  
Any help is greatly appreciated.

Stefano
