mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-20 17: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,51 @@
|
||||
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();
|
||||
this._mc = param1;
|
||||
this._clickFunc = param2;
|
||||
this._mc.addEventListener(MouseEvent.MOUSE_OVER,this.mouseOver);
|
||||
this._mc.addEventListener(MouseEvent.MOUSE_OUT,this.mouseOut);
|
||||
this._mc.addEventListener(MouseEvent.CLICK,this.mouseClick);
|
||||
this._mc.gotoAndPlay("off");
|
||||
}
|
||||
|
||||
public function release() : void
|
||||
{
|
||||
this._mc.removeEventListener(MouseEvent.MOUSE_OVER,this.mouseOver);
|
||||
this._mc.removeEventListener(MouseEvent.MOUSE_OUT,this.mouseOut);
|
||||
this._mc.removeEventListener(MouseEvent.CLICK,this.mouseClick);
|
||||
this._mc.parent.removeChild(this._mc);
|
||||
this._mc = null;
|
||||
}
|
||||
|
||||
private function mouseOver(param1:MouseEvent) : void
|
||||
{
|
||||
this._mc.gotoAndPlay("on");
|
||||
AJAudio.playHudBtnRollover();
|
||||
}
|
||||
|
||||
private function mouseOut(param1:MouseEvent) : void
|
||||
{
|
||||
this._mc.gotoAndPlay("off");
|
||||
}
|
||||
|
||||
private function mouseClick(param1:MouseEvent) : void
|
||||
{
|
||||
this._clickFunc();
|
||||
AJAudio.playHudBtnClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user