# Dynamically attached mc's and rollover/out

**URL:** https://forum.kirupa.com/t/dynamically-attached-mcs-and-rollover-out/123759
**Category:** Uncategorized
**Created:** [September 27, 2004, 3:24am UTC](https://forum.kirupa.com/t/dynamically-attached-mcs-and-rollover-out/123759 "2004-09-27T03:24:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)
#### Post date: [September 27, 2004, 3:24am UTC](https://forum.kirupa.com/t/dynamically-attached-mcs-and-rollover-out/123759/1 "2004-09-27T03:24:44Z")

</div>

okay, i’m relatively new to dynamically attaching mc’s to other mc’s as in building a dynamic menu system from xml.

the code i’m tinkering with uses an .onRelease to create a function for dynamically attached mc’s so that when you click the mc you call an URL.

i need to be able to have something like an .onRollOver and then set up a function which calls frames of that mc so i can have nice rollover and rollout animations…

i tried having a button inside my mc (the one that gets dyn. attached) and use that to do rollover/out stuff, but that seems to conflict with the .onRelease function in the other AS on my main timeline…

sorry if I didn’t explain it well enough… falling asleep here!

thanks for any help (here’s the code)

```auto
menuXml = new XML();
      menuXml.ignoreWhite = true;
      menuXml.onLoad = function(success) {
  if (success) {
   menuItem = this.firstChild.childNodes;
   for (var i=0; i<menuItem.length; i++) {
      item = _root.holder.attachMovie("itemClip", "itemClip" + i, i);
      item._x = 0;
      item._y = 20*i;
      item.itemLabel.text = menuItem*.attributes.name;
      item.myUrl = menuItem*.attributes.url;
	 item.onRelease = function() {
       getURL(this.myUrl,"_blank");
   }
  }
 }
     }
      menuXml.load("myMenu.xml");

```
