# Dynamic text fields

**URL:** <https://forum.kirupa.com/t/dynamic-text-fields/15313>\
**Category:** Uncategorized\
**Created:** [March 12, 2003, 10:35pm UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313 "2003-03-12T22:35:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbrewer](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@jbrewer](https://forum.kirupa.com/u/jbrewer)\
**Post date:** [March 12, 2003, 10:35pm UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/1 "2003-03-12T22:35:58Z")

</div>

okay, this is my first post here, so have patience, please…  
i have been working on creating a button movie clip so i can controll all the aspects of the button, specifically to create a drop down menu that appears beside the button when moused over… i am using dynamic text fields so i can use the button MC over and over and just tell it what i want it to say…  
It does display the text in the initial text field (visitor\_mc.text\_txt.text), but not in the sub-menu text field (visitor\_mc.sub1\_txt.text)… by the way the sub-menu is just later in the timeline at a label i called “rollover”… confused yet? here’s the code i was using…

visitor\_mc.text\_txt.text = “Visitors”;  
visitor\_mc.sub1\_txt.text = “Classes”;

the second line of code wont display anything…  
i have exhausted my self… please help!!!

---

<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:** [March 13, 2003, 10:04am UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/2 "2003-03-13T10:04:29Z")

</div>

Howdy and Welcome… 🙂

It is abit hard to say without seeing what you have, but here we go…

I think your code, visitor\_mc.sub1\_txt.text = “Classes”;, is not working because visitor\_mc does not exist when that command is executed… Why don’t you move that line right under the frame where ‘rollover’ label is and see if it does the trick for you…

:cowboy:

---

<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:** [March 13, 2003, 5:46pm UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/3 "2003-03-13T17:46:35Z")

</div>

that would work except that visitor\_mc is the instance name of the MC button that i created and i think you are right that it doesn’t work cos it is not loaded at that time, so… how does one go about sending that info down the visitor\_mc’s time line to the “rollover” frame?:-\  
thanks for any help y’all can offer!!!

---

<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:** [March 14, 2003, 4:20am UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/4 "2003-03-14T04:20:59Z")

</div>

Howdy… You can call me dumb, but I am not really able to imagine what you have in your file and what you are exactly trying to… Would you create a little sample that show what the problem is and what you are trying to??? 😉

---

<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:** [March 15, 2003, 12:08am UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/5 "2003-03-15T00:08:35Z")

</div>

ok here’s the fla, check it out and let me know what ya think…

thank you

---

<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:** [March 15, 2003, 8:50am UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/6 "2003-03-15T08:50:21Z")

</div>

Okay… Whole lot easier to answer the question with the file… =)

This is the script from the frame 1 of the main timeline…

```auto
visitor_mc.trackAsMenu;
visitor_mc.text_txt.text = "zap"; 
//this is the part that doesn't work...
//sub1_txt is the dynamic text field in frame 15 "rollover"
//visitor_mc.sub1_txt.text = "pop";
subText1 = "pop";

```

visitor\_mc.sub1\_txt.text = “pop”; is not working as you would expect, because that sub1\_text does not exists on the frame 1 of that movieclip timeline… It exists from frame 15 to 25…  
So, I have added another variable and assigned the value to it…

I use that variable from the movieclip itself… Frame 15 of the mc\_navbtn\_up

```auto
stop();
sub1_txt.text = _parent.subText1;
this.onRollOut = function(){
	gotoAndStop("_up");
	text_txt.textColor = 0x0000CC;
};

```

As you can see, I have assigned the value of that text field from here with the given variable that I have assigned on the main timeline…

Let me know if you need further assistance… 😉

---

<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:** [March 17, 2003, 8:55pm UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/7 "2003-03-17T20:55:20Z")

</div>

thank you so much. i had tried to assign a variable earlier, but forgot to put in \_parent!  
you’re a life saver!

---

<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:** [March 17, 2003, 9:20pm UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/8 "2003-03-17T21:20:16Z")

</div>

You’re welcome… 😉

---

<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:** [March 18, 2003, 5:04pm UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/9 "2003-03-18T17:04:58Z")

</div>

okay, this may seem dumb, but how can i use another instance of this MC and have different text in the variable? is this a matter of scope?

---

<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:** [March 19, 2003, 6:49am UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/10 "2003-03-19T06:49:36Z")

</div>

Now, you gotta change the pathing system again… :beam:  
See if this is what you want… and let me know…

```auto
visitor_mc1.trackAsMenu;
visitor_mc1.text_txt.text = "zap"; 
visitor_mc1.subText1 = "pop";
visitor_mc1.subText2 = "soda";
visitor_mc1.subText3 = "juice";

visitor_mc2.trackAsMenu;
visitor_mc2.text_txt.text = "OS"; 
visitor_mc2.subText1 = "Windows";
visitor_mc2.subText2 = "Macintosh";
visitor_mc2.subText3 = "Unix/Linux";

```

```auto
stop();
sub1_txt.text = subText1;
sub2_txt.text = subText2;
sub3_txt.text = subText3;
this.onRollOut = function(){
	gotoAndStop("_up");
	text_txt.textColor = 0x0000CC;
};

```

---

<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:** [March 19, 2003, 11:07pm UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/11 "2003-03-19T23:07:00Z")

</div>

tried that one already and the sub text fields are empty when they put after visitor\_mc. (you know), i am not sure where else to go from here…

---

<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:** [March 19, 2003, 11:24pm UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/12 "2003-03-19T23:24:26Z")

</div>

i just downloaded your version and it worked fine, but i had the exact same code when i tried it and mine wont work… bizzare. thanks, for the help.

---

<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:** [March 20, 2003, 5:11am UTC](https://forum.kirupa.com/t/dynamic-text-fields/15313/13 "2003-03-20T05:11:17Z")

</div>

Um… I don’t know why yours didn’t work, but as long as you got one working copy… 😉
