# Variables of duplicated textbox/MC's

**URL:** <https://forum.kirupa.com/t/variables-of-duplicated-textbox-mcs/24303>\
**Category:** flash\
**Created:** [June 28, 2003, 4:25pm UTC](https://forum.kirupa.com/t/variables-of-duplicated-textbox-mcs/24303 "2003-06-28T16:25:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baggio](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@Baggio](https://forum.kirupa.com/u/Baggio)\
**Post date:** [June 28, 2003, 4:25pm UTC](https://forum.kirupa.com/t/variables-of-duplicated-textbox-mcs/24303/1 "2003-06-28T16:25:25Z")

</div>

Hey

If i have a MC which contains a textbox say with variable myTEXT assigned to it, when i duplicate this text box how do i call the variable for each textbox there after?

Thanks

---

<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:** [June 28, 2003, 4:57pm UTC](https://forum.kirupa.com/t/variables-of-duplicated-textbox-mcs/24303/2 "2003-06-28T16:57:08Z")

</div>

Well it all depends on how you are duplicating the clip (just using duplicateMovieClip(), or maybe using a for loop).

[AS]clipInstanceName.duplicateMovieClip(newName, level)[/AS]

That is the basic set up of duplicate movie clip. You need the newName attribute so that you don’t have clips with the same instance name. So your duplicated clips instance name is the name you put in the newName attribute.

So lets say I use…

[AS]myClip.duplicateMovieClip(“myClip2”, 1000);[/AS]

That duplicates myClip and makes a myClip2 I can then take this farther by targeting myClip2.

[AS]myClip.duplicateMovieClip(“myClip2”, 1000);  
myClip2.\_x = 200;  
myClip2.\_y = 100;[/AS]

That will position your duplicated clip at (200, 100).

So now about targeting the variable inside…

[AS]myClip.duplicateMovieClip(“myClip2”, 1000);  
myClip2.myTEXT = “value”;[/AS]

---

<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:** [June 28, 2003, 4:57pm UTC](https://forum.kirupa.com/t/variables-of-duplicated-textbox-mcs/24303/3 "2003-06-28T16:57:13Z")

</div>

if your mc contains a textbox with variable myTEXT, u have obviously named the duplicated text box, say myTEXT2,  
Say you want the text2 box to say words on rollover, use;  
on (rollOver) {  
\_root.movieclipname.myTEXT2 = “hello”;  
}  
on (rollOut) {  
\_root.movieclipname.myTEXT2 = “”;  
}  
on (release) {  
\_root.movieclipname.myTEXT = “U are here”;  
}

Does this help, or am I missing th point?. =)

---

<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:** [June 28, 2003, 4:58pm UTC](https://forum.kirupa.com/t/variables-of-duplicated-textbox-mcs/24303/4 "2003-06-28T16:58:27Z")

</div>

maybe i should leave this 2 the pro’s hey ‘lostinbeta’ =)

---

<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:** [June 28, 2003, 5:01pm UTC](https://forum.kirupa.com/t/variables-of-duplicated-textbox-mcs/24303/5 "2003-06-28T17:01:03Z")

</div>

I think i understand now, i’ll experiment with it thanks 😉

---

<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:** [June 28, 2003, 5:03pm UTC](https://forum.kirupa.com/t/variables-of-duplicated-textbox-mcs/24303/6 "2003-06-28T17:03:01Z")

</div>

> \*Originally posted by .:®:. \*  
> \*\*maybe i should leave this 2 the pro’s hey ‘lostinbeta’ =) \*\*

HAHAHA, I am no pro, not even close! I will get there eventually though… :run:

Baggio: Cool, good luck man 🙂
