mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-21 01:37:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,57 @@
|
||||
package game
|
||||
{
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.MouseEvent;
|
||||
|
||||
public class GuiButton
|
||||
{
|
||||
|
||||
private var _mc:MovieClip;
|
||||
|
||||
private var _clickFunc:Function;
|
||||
|
||||
public function GuiButton(param1:MovieClip, param2:Function)
|
||||
{
|
||||
super();
|
||||
_mc = param1;
|
||||
_clickFunc = param2;
|
||||
_mc.addEventListener("rollOver",mouseOver);
|
||||
_mc.addEventListener("rollOut",mouseOut);
|
||||
_mc.addEventListener("mouseDown",mouseClick);
|
||||
_mc.gotoAndStop("off");
|
||||
}
|
||||
|
||||
public function release() : void
|
||||
{
|
||||
_mc.removeEventListener("rollOver",mouseOver);
|
||||
_mc.removeEventListener("rollOut",mouseOut);
|
||||
_mc.removeEventListener("mouseDown",mouseClick);
|
||||
_mc.parent.removeChild(_mc);
|
||||
_mc = null;
|
||||
}
|
||||
|
||||
private function mouseOver(param1:MouseEvent) : void
|
||||
{
|
||||
if(_mc.currentFrameLabel != "on")
|
||||
{
|
||||
_mc.gotoAndPlay("on");
|
||||
}
|
||||
AJAudio.playHudBtnRollover();
|
||||
}
|
||||
|
||||
private function mouseOut(param1:MouseEvent) : void
|
||||
{
|
||||
if(_mc.currentFrameLabel != "off")
|
||||
{
|
||||
_mc.gotoAndPlay("off");
|
||||
}
|
||||
}
|
||||
|
||||
private function mouseClick(param1:MouseEvent) : void
|
||||
{
|
||||
_clickFunc();
|
||||
AJAudio.playHudBtnClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user