Skip to main content
Aug 10, 2006 2:26 PM UTC
Answered

Using Variables for Instance Names

Hi,

I'm hoping someone can help me understand the right way to do this. Basically I have some programmatically attached movie clips which are attached in a loop, so the only way I can reference their Instance names is through using a variable. I want to do this so that I can attach a createTextField to each clip instead of _root which is what I do now For example I'm tring to do this:

for (i=0;i<5;i++){
clip2 = _root.attachMovie("A","A"+i,{_x:coordx,_y:coordy});
Variable-which-is-named-("A"+i)-here.createTextField("_text"+i,depth,coordx+5,coordy+5,40,30);
}

I hope that makes sense? If anyone can point me in the right direction I'm not having luck with google searches

Best Regards,
Tom
This topic is closed to new replies. Start a new post to keep the conversation going.
kglad
kgladCorrect answer
Community Expert
Aug 10, 2006 2:31 PM UTC
you can use either:

3 replies

kglad
Community Expert
Community Expert
Aug 10, 2006 3:08 PM UTC
you're welcome.
Translate
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
Aug 10, 2006 2:31 PM UTC
you can use either:

Translate
Aug 10, 2006 2:52 PM UTC
kglad,

Thanks!! it was right in front of me the whole time ! this is great.

Best Regards,
Tom
Translate