# AS2: Problem with manipulating buttons

**URL:** <https://forum.kirupa.com/t/as2-problem-with-manipulating-buttons/247626>\
**Category:** Uncategorized\
**Created:** [December 27, 2007, 1:24pm UTC](https://forum.kirupa.com/t/as2-problem-with-manipulating-buttons/247626 "2007-12-27T13:24:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ezence](https://avatars.discourse-cdn.com/v4/letter/e/57b2e6/32.png) [@Ezence](https://forum.kirupa.com/u/Ezence)\
**Post date:** [December 27, 2007, 1:24pm UTC](https://forum.kirupa.com/t/as2-problem-with-manipulating-buttons/247626/1 "2007-12-27T13:24:18Z")

</div>

I have a button, which slides across when I hover above it, and then slides back when the mouse rolls off:

```auto
 
productsall_btn.onRollOver = function() {
 play();
 rewind = false;
}
productsall_btn.onRollOut = function() {
   rewind = true;
}
 
this.onEnterFrame = function() {
 if (rewind == true) {
  prevFrame();
 }
}

```

That all works fine, except I’ve got buttons inside this button (which are created dynamically from an xml document), which are supposed the be hyperlinks. However, when someone hovers on one of them to go to a link, the container button slides back, as it thinks it’s lost focus.

Here’s the code (though you probably don’t need all of it):

```auto
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success){
 if(success){
   CreateMenuProducts(my_xml, 0);
 }
}
my_xml.load("my_document.xml");
var xPos = -110;
var yPos = -45;
var num_items;
function CreateMenuProducts(my_xml){
 
 var items = my_xml.firstChild.childNodes;
 num_items = items.length;
 var i = 0;
 while(i<items.length && i<8) {
  var name = items*.firstChild;
  var location = items*.childNodes[1];
  //attach the container clip
  attachMovie("menuitem_mc", "new"+i, i, {_x:xPos, _y:yPos});
  //increase the y postion each time
  yPos += this["new"+i]._height+11;
  xPos -= 25;
  //add the information
 
  if(num_items > 8 && i==7) {
   this["new"+i].name_txt.text = "More...";
   this["new"+i].onRelease = function() {
    this["new"+i].name_txt.text = "te";
 
   }
  }
  else
   this["new"+i].name_txt.text = name.firstChild.nodeValue;
 
 
  if(i == 3) {
   xPos = 30;
   yPos = -45;
  }
 
  ++i;
 
 } 
}

```

Any ideas of how the Symbols should be structured?
