# as2.0 expand/collapse menu help needed

**URL:** https://forum.kirupa.com/t/as2-0-expand-collapse-menu-help-needed/267437
**Category:** flash
**Created:** [August 1, 2008, 1:18am UTC](https://forum.kirupa.com/t/as2-0-expand-collapse-menu-help-needed/267437 "2008-08-01T01:18:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gmb](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@gmb](https://forum.kirupa.com/u/gmb)
#### Post date: [August 1, 2008, 1:18am UTC](https://forum.kirupa.com/t/as2-0-expand-collapse-menu-help-needed/267437/1 "2008-08-01T01:18:59Z")

</div>

Hi,

I’m working on an expand/collapse menu in as2.0, so far the menu expands properly but when I click on the next heading it doesn’t collapse the same way it expanded, which is the effect I am trying to achieve. How can I change the script so the menu expands/collapses in the same way, and is it possible to speed up the expansion/collapse? I have attached a zip of the fla and swf.

thanks for the help  
Greg

Here is my as for each menu (header) button…

stop();

this.onEnterFrame = function(){  
if(rewind == true){  
prevFrame();  
}  
}  
this.onRollOver = function(){  
rewind = false;  
play();  
}  
this.onRollOut = function(){  
rewind = true;  
}  
this.onRelease = function(){  
tellTarget ("/main")  
gotoAndPlay(15);  
}  
stop();
