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?