# Button doesn't work after 1st time used?

**URL:** <https://forum.kirupa.com/t/button-doesnt-work-after-1st-time-used/289286>\
**Category:** flash\
**Created:** [May 28, 2009, 2:17pm UTC](https://forum.kirupa.com/t/button-doesnt-work-after-1st-time-used/289286 "2009-05-28T14:17:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![icekomo](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@icekomo](https://forum.kirupa.com/u/icekomo)\
**Post date:** [May 28, 2009, 2:17pm UTC](https://forum.kirupa.com/t/button-doesnt-work-after-1st-time-used/289286/1 "2009-05-28T14:17:29Z")

</div>

Hello All,  
I have a few buttons in my fla and when you click on them, they bring that section to the top of the piles of sections. Here is the code for that:

//Reservations  
reservationsBtn\_mc.addEventListener(MouseEvent.CLICK, reservations);

function reservations(event:MouseEvent):void  
{  
MovieClip(root).reservations\_mc.gotoAndPlay(2);  
addChild(MovieClip(root).reservations\_mc);  
}  
MovieClip(root).reservations\_mc.x = -618.24;  
MovieClip(root).reservations\_mc.y = 194;

//Group Dining  
groupDiningBtn\_mc.addEventListener(MouseEvent.CLICK, group);

function group(event:MouseEvent):void  
{  
MovieClip(root).groupDining\_mc.gotoAndPlay(2);  
addChild(MovieClip(root).groupDining\_mc);

}

```
MovieClip(root).groupDining_mc.x = -618.24;
MovieClip(root).groupDining_mc.y = 194;

```

These buttons are also linked up to a external .as file to control there rollOver/Out actions:  
package  
{  
import flash.display.MovieClip;  
import flash.events.Event;  
import flash.events.MouseEvent;  
import fl.controls.Button;

```
public class btnEffect extends MovieClip

{
	var rewind:Boolean = false;
	
	public function btnEffect()
	{
			this.buttonMode = true;
			this.mouseChildren = false;
			this.addEventListener(MouseEvent.MOUSE_OVER, rollOn);
			this.addEventListener(MouseEvent.MOUSE_OUT, rollOff);
			this.addEventListener(Event.ENTER_FRAME,revFrame);
	}
	
	public function rollOn(event:MouseEvent):void
	{
		play();
		rewind = false;
    }
	
	public function rollOff(event:MouseEvent):void
	{
		rewind = true;
	}
	
	public function revFrame(event:Event):void
	{
		if(rewind == true){
		prevFrame();
		this.addEventListener(MouseEvent.MOUSE_OVER, rollOn);
	}
	
	}
	
}

```

}

The problem I am having is, once the site is tested, everything works great…the first time. After that to get the buttons to bring up the correct sections I have to double click on the button. Does anyone have any idea what might be causing this?
