home *** CD-ROM | disk | FTP | other *** search
- class Interface extends MovieClip
- {
- var btnPlay;
- var mcControl;
- var btnInstructions;
- var btnSend;
- var btnHighScore;
- var oSpaceLst;
- var mcInstructionsPanel;
- static var instance;
- function Interface(Void)
- {
- super();
- Interface.instance = this;
- this.btnPlay = this.mcControl.btnPlay;
- this.btnInstructions = this.mcControl.btnInstructions;
- this.btnSend = this.mcControl.btnSend;
- this.btnHighScore = this.mcControl.btnHighScore;
- this.btnPlay.onRelease = mx.utils.Delegate.create(this,this.onReleasePlay);
- this.btnInstructions.onRelease = mx.utils.Delegate.create(this,this.onReleaseInstructions);
- this.btnSend.onRelease = mx.utils.Delegate.create(this,this.onReleaseSend);
- this.btnHighScore.onRelease = mx.utils.Delegate.create(this,this.onReleaseHighScore);
- this.oSpaceLst = new Object();
- this.oSpaceLst.onKeyDown = mx.utils.Delegate.create(this,this.onPressSpace);
- Key.addListener(this.oSpaceLst);
- }
- static function getInstance(Void)
- {
- return Interface.instance;
- }
- function onReleasePlay(Void)
- {
- Key.removeListener(this.oSpaceLst);
- _root.gotoAndPlay("gameIn");
- }
- function onReleaseInstructions(Void)
- {
- Key.removeListener(this.oSpaceLst);
- this.mcInstructionsPanel.btnBack.onRelease = mx.utils.Delegate.create(this,this.onReleaseInstrBack);
- this.gotoAndPlay("instructionsIn");
- }
- function onReleaseSend(Void)
- {
- Key.removeListener(this.oSpaceLst);
- this.gotoAndPlay("sendIn");
- }
- function onReleaseHighScore(Void)
- {
- Key.removeListener(this.oSpaceLst);
- this.gotoAndPlay("highIn");
- }
- function onReleaseInstrBack(Void)
- {
- Key.addListener(this.oSpaceLst);
- this.gotoAndPlay("instructionsOut");
- }
- function onReleaseSendBack(Void)
- {
- Key.addListener(this.oSpaceLst);
- this.gotoAndPlay("sendOut");
- }
- function onReleaseScoreBack(Void)
- {
- Key.addListener(this.oSpaceLst);
- this.gotoAndPlay("highOut");
- }
- function onPressSpace(Void)
- {
- if(Key.isDown(32))
- {
- this.onReleasePlay();
- }
- }
- }
-