# Targetting problem

**URL:** <https://forum.kirupa.com/t/targetting-problem/59765>\
**Category:** Uncategorized\
**Created:** [August 3, 2004, 5:48pm UTC](https://forum.kirupa.com/t/targetting-problem/59765 "2004-08-03T17:48:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fumeng](https://avatars.discourse-cdn.com/v4/letter/f/a9adbd/32.png) [@fumeng](https://forum.kirupa.com/u/fumeng)\
**Post date:** [August 3, 2004, 5:48pm UTC](https://forum.kirupa.com/t/targetting-problem/59765/1 "2004-08-03T17:48:17Z")

</div>

hi. i’ve got a loop which creates several movie clips with a text field inside each one.

```auto

// Create the Empty Movie Clip
_root.createEmptyMovieClip("dateClip"+j,300+j);
var dateClip:MovieClip = _root["dateClip"+j];
			
// Create a Text Field Inside them
dateClip.createTextField("thisDate"+j,j,0,0,indColWidth,colHeight);

```

now, in another function that occurs later in the program, i want to access those clips and set some properties to change. i see from listing the variables in the debugger that these clips exist at level0, but i cannot access them that way. i try to do this but it keeps returning undefined:

```auto

trace(_level0.dateClip["thisDate"+today]); // today is a random value which i can trace

```

i know i’m missing something simple but cannot figure it out.

thanks. fumeng.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 3, 2004, 7:14pm UTC](https://forum.kirupa.com/t/targetting-problem/59765/2 "2004-08-03T19:14:10Z")

</div>

I guess you are using MX04 then.

```auto
j=1
// Create the Empty Movie Clip
_root.createEmptyMovieClip("dateClip"+j,300+j);
var dateClip:MovieClip = _root["dateClip"+j];
			
// Create a Text Field Inside them
dateClip.createTextField("thisDate"+j,j,0,0,indColWidth,colHeight);
trace(_level0.dateClip["thisDate"+1]); // today is a random value which i can trace

```

works fine.

you said you use functions. is it possible that you either create the  
var dateClip  
in a function (the “var” makes the variable only availible inside this function),  
or try to access it in another function where it isn’t available

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 3, 2004, 7:29pm UTC](https://forum.kirupa.com/t/targetting-problem/59765/3 "2004-08-03T19:29:58Z")

</div>

yes, you’re right. i create the var within a function and then try and call it from within another function. thanks!
