# attachMovie ..a depth problem I think?

**URL:** <https://forum.kirupa.com/t/attachmovie-a-depth-problem-i-think/215478>\
**Category:** flash\
**Created:** [February 7, 2007, 4:49pm UTC](https://forum.kirupa.com/t/attachmovie-a-depth-problem-i-think/215478 "2007-02-07T16:49:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zaid\_W1red](https://avatars.discourse-cdn.com/v4/letter/z/cab0a1/32.png) [@Zaid\_W1red](https://forum.kirupa.com/u/Zaid_W1red)\
**Post date:** [February 7, 2007, 4:49pm UTC](https://forum.kirupa.com/t/attachmovie-a-depth-problem-i-think/215478/1 "2007-02-07T16:49:41Z")

</div>

Hey guys,

here’s my as:

```auto

var uniqueDepth = 0;
function makeMenu(myX, menuid) {
 rows = 10;
 for (i=0; i<rows; i++) {
  curr_item = curr_menu.attachMovie("menuitem", "item"+i+"_mc", uniqueDepth);
  curr_item._x = myX;
  curr_item._y = 15*i;
  trace(curr_item._y);
  curr_item.onRelease = function() {
   makeMenu(230*menuid);
   menuid++;
  };
  uniqueDepth++;
  urlbutton = curr_menu.attachMovie('menuitemurl', 'myurl'+uniqueDepth, uniqueDepth+1*rows);
  urlbutton._x = curr_item._width;
  urlbutton._y = curr_item._y;
  urlbutton.onRelease = function() {
   trace('url');
  };
  uniqueDepth++;
 }
}
makeMenu(0, 1);

```

Basically Im trying to create a menu, and when you click an item, a ‘sub menu’ open directly to its right. Based loosely on the xml menu tute here a kirupa, except I want to attach more then one button for each menu item, in this case a url button.

The initial menu laods fine, but the second stage is missing the url button …and I cant figure out why.

Pleas enote this code has just been put together whiel i work out …er…how this works! lol.

FLA Also attached…any help would be awesome!

Zaid
