# Concatonating text

**URL:** https://forum.kirupa.com/t/concatonating-text/300948
**Category:** Uncategorized
**Created:** [December 1, 2009, 5:59am UTC](https://forum.kirupa.com/t/concatonating-text/300948 "2009-12-01T05:59:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![fieromx](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@fieromx](https://forum.kirupa.com/u/fieromx)
#### Post date: [December 1, 2009, 5:59am UTC](https://forum.kirupa.com/t/concatonating-text/300948/1 "2009-12-01T05:59:58Z")

</div>

I’m writing a menu generating script. It’s suppose to display arrays  
and any inner arrays. **ex:** [[COLOR=Black]"[/COLOR][COLOR=Red]test item[COLOR=Black]"[/COLOR][/COLOR],["[COLOR=Red]item 1[/COLOR]",["[COLOR=Magenta]item 2[/COLOR]","[COLOR=Magenta]item 3[/COLOR]"]],"[COLOR=Red]item 4[/COLOR]"];

These movie clips should be displayed if the actionscript is correct.:  
[COLOR=Red]test item  
item 1 [COLOR=Black]\<—this of course, has a following subarray[/COLOR]  
item 4[/COLOR]  
and the submenu should display:  
[COLOR=Magenta]item 2  
[/COLOR][COLOR=Magenta]item 3[/COLOR]

I run the script and it see’s the [COLOR=Magenta]inner[/COLOR] array items [[COLOR=Magenta]"[/COLOR][COLOR=Magenta]item 2[/COLOR][COLOR=Magenta]", “item 3”[/COLOR]] and shows them in the next submenu -FINE—but what I get in the main menu to my surprise is ‘run-on text’ in the **Dynamic field** of that movieclip. ex:

[COLOR=Red]test item [/COLOR]  
[COLOR=Red]item 1; item 2; item 3 [/COLOR] \<— **?** seems to concatonate inner items in text field  
[COLOR=Red]item 4[/COLOR]

I only want to see text “item 1” …not the items associated with it as well.  
(they are already displayed in submenu)

…some partial script, …If I haven’t explained it well, I’ll understand if no one responds.

for (var i = 0; i \< menuArray.length; i++) {  
var menuItemName = “mc\_menu\_item\_” + i;

```
        if (typeof(menuArray*) == "object") {
            
            this["mc_menu_box"].attachMovie("h_menu_middle_sub", menuItemName, tempLevel);
```
