mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-21 09: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,76 @@
|
||||
package gui
|
||||
{
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.MouseEvent;
|
||||
import loader.MediaHelper;
|
||||
|
||||
public class WelcomeToCarnival
|
||||
{
|
||||
|
||||
public static const WELCOME_CARNIVAL_MEDIA_ID:int = 1594;
|
||||
|
||||
private var _popup:MovieClip;
|
||||
|
||||
private var _mediaHelper:MediaHelper;
|
||||
|
||||
public function WelcomeToCarnival()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
this._mediaHelper = new MediaHelper();
|
||||
this._mediaHelper.init(WELCOME_CARNIVAL_MEDIA_ID,this.mediaCallback,true);
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
this.removeListeners();
|
||||
this._mediaHelper.destroy();
|
||||
GuiManager.guiLayer.removeChild(this._popup);
|
||||
DarkenManager.unDarken(this._popup);
|
||||
this._popup = null;
|
||||
}
|
||||
|
||||
private function mediaCallback(img:MovieClip) : void
|
||||
{
|
||||
this._popup = MovieClip(img.getChildAt(0));
|
||||
this._popup.x = MainFrame.VIEW_WIDTH * 0.5;
|
||||
this._popup.y = MainFrame.VIEW_HEIGHT * 0.5;
|
||||
GuiManager.guiLayer.addChild(this._popup);
|
||||
this.addListeners();
|
||||
this.setInitialConditions();
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
DarkenManager.darken(this._popup);
|
||||
}
|
||||
|
||||
private function setInitialConditions() : void
|
||||
{
|
||||
}
|
||||
|
||||
private function popupCloseHandler(e:MouseEvent) : void
|
||||
{
|
||||
e.stopPropagation();
|
||||
this.destroy();
|
||||
}
|
||||
|
||||
private function onPopup(e:MouseEvent) : void
|
||||
{
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
private function addListeners() : void
|
||||
{
|
||||
this._popup["bx"].addEventListener(MouseEvent.MOUSE_DOWN,this.popupCloseHandler,false,0,true);
|
||||
this._popup.addEventListener(MouseEvent.MOUSE_DOWN,this.onPopup,false,0,true);
|
||||
}
|
||||
|
||||
private function removeListeners() : void
|
||||
{
|
||||
this._popup["bx"].removeEventListener(MouseEvent.MOUSE_DOWN,this.popupCloseHandler);
|
||||
this._popup.addEventListener(MouseEvent.MOUSE_DOWN,this.onPopup,false,0,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user