# How do I add to this dynamically {menu1:{url:\['a.swf'\]}}

**URL:** <https://forum.kirupa.com/t/how-do-i-add-to-this-dynamically-menu1-url-a-swf/181933>\
**Category:** Uncategorized\
**Created:** [March 14, 2006, 12:23pm UTC](https://forum.kirupa.com/t/how-do-i-add-to-this-dynamically-menu1-url-a-swf/181933 "2006-03-14T12:23:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bootiteq](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@bootiteq](https://forum.kirupa.com/u/bootiteq)\
**Post date:** [March 14, 2006, 12:23pm UTC](https://forum.kirupa.com/t/how-do-i-add-to-this-dynamically-menu1-url-a-swf/181933/1 "2006-03-14T12:23:33Z")

</div>

I dont know what this is called so I dont really know what to ask…

What I was hoping to do was something similar to this code below but dont know the syntax to update it dynamically.

```
 ActionScript Code:
 [FONT=Courier New][LEFT]sub = [COLOR=#000000]{[/COLOR]menu1:[COLOR=#000000]{[/COLOR][COLOR=#0000ff]url[/COLOR]:[COLOR=#000000][[/COLOR][COLOR=#ff0000]'this.swf'[/COLOR][COLOR=#000000]][/COLOR], targ:[COLOR=#000000][[/COLOR][COLOR=#ff0000]'my_mc'[/COLOR][COLOR=#000000]][/COLOR][COLOR=#000000]}[/COLOR], menu2:[COLOR=#000000]{[/COLOR][COLOR=#0000ff]url[/COLOR]:[COLOR=#000000][[/COLOR][COLOR=#ff0000]'this2.swf'[/COLOR][COLOR=#000000]][/COLOR], targ:[COLOR=#000000][[/COLOR][COLOR=#ff0000]'my_mc2'[/COLOR][COLOR=#000000]][/COLOR][COLOR=#000000]}[/COLOR][COLOR=#000000]}[/COLOR];

```

[COLOR=#0000ff]trace[/COLOR]COLOR=#000000[/COLOR]; [COLOR=#808080]\*//traces my\_mc2 \*[/COLOR]

[/LEFT]  
[/FONT]

Ive thought of two methods but neither work

eg1 ActionScript Code:  
[FONT=Courier New][LEFT]sub = [COLOR=#000000]{[/COLOR][COLOR=#000000]};[/COLOR]  
sub.[COLOR=#0000ff]push[/COLOR][COLOR=#000000]([/COLOR]menu1:[COLOR=#000000]{[/COLOR][COLOR=#0000ff]url[/COLOR]:[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘this.swf’[/COLOR][COLOR=#000000]][/COLOR], targ:[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘my\_mc’[/COLOR][COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR];  
[COLOR=#808080]\*// generates a syntax error \*[/COLOR]

[/LEFT]  
[/FONT]

eg2 would probably work (bit hacky) if I knew how to destroy a string

```
 ActionScript Code:
 [FONT=Courier New][LEFT]sub = [COLOR=#000000]{[/COLOR][COLOR=#000000]};[/COLOR]

```

sub +=[COLOR=#ff0000]“menu1:{url:[‘this.swf’], targ:[‘my\_mc’]”[/COLOR];  
[/LEFT]  
[/FONT]

Any ideas or links to tuts? im a little stumped :rocker:
