//Button 1 Listeners and Functions
Btn1_hit.addEventListener(MouseEvent.MOUSE_OVER,Bu tton1Over);
Btn1_hit.addEventListener(MouseEvent.MOUSE_OUT,But ton1Out);
Btn1_hit.addEventListener(MouseEvent.MOUSE_DOWN,Bu tton1Click);
Btn1_hit.addEventListener(MouseEvent.MOUSE_UP,Butt on1Up);
//Mouse Over
function Button1Over(e:MouseEvent):void
{
Btn1.gotoAndPlay("1Over");
Btn1.addEventListener(Event.ENTER_FRAME,Stop1);
function Stop1(e:Event):void
{
if (Btn1.currentFrameLabel == "1Out")
{
Btn1.stop();
}
}
}
//Mouse Out
function Button1Out(e:MouseEvent):void
{
Btn1.addEventListener(Event.ENTER_FRAME,Play1);
function Play1(e:Event):void
{
if (Btn1.currentFrameLabel == "1Out")
{
Btn1.gotoAndPlay("1Out");
}
}
}
function Button1Click(e:MouseEvent):void
{
Btn1.gotoAndStop("1Click");
}
function Button1Up(e:MouseEvent):void
{
Btn1.gotoAndStop("1Out");
//link to scene
}