Targetting problem

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


// 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:


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.

I guess you are using MX04 then.

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

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