# Accordion sliding menu

**URL:** <https://forum.kirupa.com/t/accordion-sliding-menu/235609>\
**Category:** flash\
**Created:** [August 13, 2007, 12:39pm UTC](https://forum.kirupa.com/t/accordion-sliding-menu/235609 "2007-08-13T12:39:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![michey](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@michey](https://forum.kirupa.com/u/michey)\
**Post date:** [August 13, 2007, 12:39pm UTC](https://forum.kirupa.com/t/accordion-sliding-menu/235609/1 "2007-08-13T12:39:14Z")

</div>

Hi  
I’ve build a very simple horizontal accordion-like sliding Menu.  
It works except for the rollout after the release, then it slides back instead of staying in position.  
The problem is that I need a slide back after the rollover on the rollout.  
But I dont after the release.  
In the end it should look like [\>\>this\<\<](http://www.templatemonster.com/swish-templates/15936.html).

```php
function movItem(clip, speed, x) {
 clip.onEnterFrame = function() {
  var a = Math.abs(x-clip._x);
  clip._x += (Math.round(x-clip._x))/speed;
  if (a<=1) {
   clip._x = x;
   delete clip.onEnterFrame;
  }
 };
}
for (var i = 1; i<6; i++) {
 this["mc"+i].ID = i;
 this["mc"+i].onRollOver = function() {
  if (this.ID == 1) {
   movItem(mc1, 5, 30);
   movItem(mc2, 5, 60);
   movItem(mc3, 5, 90);
  }
  if (this.ID == 2) {
   movItem(mc2, 5, 60);
   movItem(mc3, 5, 90);
  }
  if (this.ID == 3) {
   movItem(mc3, 5, 90);
  }
 };
 this["mc"+i].onRollOut = function() {
  if (this.ID == 1) {
   movItem(mc1, 5, 0);
   movItem(mc2, 5, 30);
   movItem(mc3, 5, 60);
  }
  if (this.ID == 2) {
   movItem(mc2, 5, 30);
   movItem(mc3, 5, 60);
  }
  if (this.ID == 3) {
   movItem(mc3, 5, 60);
  }
 };
 this["mc"+i].onRelease = function() {
  if (this.ID == 1) {
   movItem(mc1, 5, 220);
   movItem(mc2, 5, 250);
   movItem(mc3, 5, 280);
  }
  if (this.ID == 2) {
   movItem(mc2, 5, 250);
   movItem(mc3, 5, 280);
  }
  if (this.ID == 3) {
   movItem(mc3, 5, 280);
  }
 };
}

```

Does somebody have suggestions about make it work like the example in the link or a better starting point to reach what I’m after?
