home *** CD-ROM | disk | FTP | other *** search
- class PopUp extends MovieClip
- {
- var sFrame;
- var aSt;
- var nWidth;
- var bt_Y;
- var bt_N;
- var bt_X;
- var tT_0;
- var nHeight;
- var tT_1;
- var tT_2;
- var mBar;
- static var nBorder = 4;
- static var nOffset_x = 40;
- static var nWidth_s = 340;
- static var nHeight_s = 180;
- var bScreen = true;
- function PopUp()
- {
- super();
- }
- function init()
- {
- if(this._y == 0)
- {
- this._x = Global.WIDTH / 2;
- this._y = Global.HEIGHT / 2;
- }
- if(this.bScreen)
- {
- Common.enabledFor(true,this,_root,-16384);
- }
- else
- {
- Common.enabledFor(true,this,this,-16384);
- }
- switch(this.sFrame)
- {
- case "y_n":
- this.attachMovie("Btn","bt_X",10,{sTxt:"X",autoSize:"right"});
- this.attachMovie("Btn","bt_Y",9,{sTxt:(this.aSt[1] != undefined ? this.aSt[1] : "YES"),autoSize:"right"});
- §§push("sTxt");
- §§push(this.aSt[2]);
- §§push(undefined);
- break;
- case "ok":
- this.attachMovie("Btn","bt_X",10,{sTxt:"X",autoSize:"right"});
- this.attachMovie("Btn","bt_Y",9,{sTxt:(this.aSt[1] != undefined ? this.aSt[1] : "OK"),autoSize:"center"});
- this.attachMovie("Txt","tT_0",7,{sTxt:(this.aSt[0] != undefined ? this.aSt[0] : "TXT"),_obFormat:{align:"center"},obCustom:{bCustom:true,multiline:true,wordWrap:true}});
- addr203:
- this.gotoAndStop(2);
- break;
- case "submit":
- this.attachMovie("Btn","bt_X",10,{sTxt:"X",autoSize:"right"});
- this.attachMovie("Btn","bt_Y",9,{sTxt:"SUBMIT",autoSize:"center"});
- this.attachMovie("Txt","tT_0",8,{sTxt:"NAME :"});
- this.attachMovie("Txt","tT_1",7,{sTxt:"SCORE : " + (this.aSt[1] != undefined ? this.aSt[1] : 0)});
- this.attachMovie("Txt","tT_2",6,{sTxt:(this.aSt[0] != undefined ? this.aSt[0] : "YOUR NAME"),obCustom:{bCustom:true,type:"input",selectable:true,maxChars:9,restrict:"^ ",border:true,borderColor:0}});
- §§goto(addr203);
- case "message":
- this.attachMovie("Txt","tT_0",10,{sTxt:(this.aSt[0] != undefined ? this.aSt[0] : "TXT"),_obFormat:{align:"center"}});
- §§goto(addr203);
- default:
- §§goto(addr203);
- }
- }
- function inFrame()
- {
- switch(this.sFrame)
- {
- case "y_n":
- this.nWidth = int(Math.max(PopUp.nWidth_s,this.bt_Y._width + this.bt_N._width + PopUp.nOffset_x * 3));
- this.bt_X._x = int(this.nWidth / 2 - PopUp.nBorder - Btn.nBorder);
- this.bt_Y._x = int(- PopUp.nOffset_x);
- this.bt_N._x = int(PopUp.nOffset_x);
- this.tT_0._x = 0;
- this.tT_0.tTxt._width = this.nWidth - PopUp.nOffset_x;
- this.tT_0.replace();
- this.nHeight = int(Math.max(PopUp.nHeight_s,this.tT_0.tTxt.textHeight + PopUp.nOffset_x * 3));
- this.bt_X._y = int((- this.nHeight) / 2 + PopUp.nBorder);
- this.bt_N._y = _loc0_ = int(this.nHeight / 2 - PopUp.nOffset_x);
- this.bt_Y._y = _loc0_;
- this.tT_0._y = - int(PopUp.nOffset_x / 2 + this.tT_0.tTxt.textHeight / 2);
- this.bt_Y.release = function()
- {
- if(this._parent.rtFun(true))
- {
- this._parent.remove();
- }
- };
- this.bt_N.release = function()
- {
- if(this._parent.rtFun(false))
- {
- this._parent.remove();
- }
- };
- break;
- case "ok":
- this.nWidth = PopUp.nWidth_s;
- this.bt_X._x = int(this.nWidth / 2 - PopUp.nBorder - Btn.nBorder);
- this.bt_Y._x = 0;
- this.tT_0._x = 0;
- this.tT_0.tTxt._width = this.nWidth - PopUp.nOffset_x;
- this.tT_0.replace();
- this.nHeight = int(Math.max(PopUp.nHeight_s,this.tT_0.tTxt.textHeight + PopUp.nOffset_x * 3));
- this.bt_X._y = int((- this.nHeight) / 2 + PopUp.nBorder);
- this.bt_Y._y = int(this.nHeight / 2 - PopUp.nOffset_x);
- this.tT_0._y = - int(PopUp.nOffset_x / 2 + this.tT_0.tTxt.textHeight / 2);
- this.bt_Y.release = function()
- {
- if(this._parent.rtFun(true))
- {
- this._parent.remove();
- }
- };
- break;
- case "submit":
- this.nWidth = int(Math.max(PopUp.nWidth_s,this.tT_1.tTxt.textWidth + this.tT_2.tTxt.textWidth + PopUp.nOffset_x * 2));
- this.bt_X._x = int(this.nWidth / 2 - PopUp.nBorder - Btn.nBorder);
- this.tT_1._x = _loc0_ = int((- this.nWidth) / 2 + PopUp.nOffset_x);
- this.tT_0._x = _loc0_;
- this.tT_2._x = this.tT_0._x + this.tT_0.tTxt.textWidth + 15;
- this.nHeight = int(PopUp.nOffset_x * 5);
- this.bt_X._y = int((- this.nHeight) / 2 + PopUp.nBorder);
- this.bt_Y._y = int((- this.nHeight) / 2 + PopUp.nOffset_x * 4);
- this.tT_0._y = int((- this.nHeight) / 2 + PopUp.nOffset_x);
- this.tT_1._y = int((- this.nHeight) / 2 + PopUp.nOffset_x * 2);
- this.tT_2._y = int((- this.nHeight) / 2 + PopUp.nOffset_x);
- this.bt_Y.release = function()
- {
- var _loc3_ = this._parent.tT_2.tTxt.text;
- if(_loc3_.length > 0)
- {
- Global.SUBMIT(_loc3_,this._parent.aSt[1]);
- Global.mTemp = _root.attachMovie("PopUp","PopUp" + _root.getNextHighestDepth(),_root.getNextHighestDepth(),{sFrame:"message",aSt:["SENDING..."]});
- Global.SUBMITEND = function()
- {
- Global.mTemp.remove();
- _root.attachMovie("PopUp","PopUp" + _root.getNextHighestDepth(),_root.getNextHighestDepth(),{sFrame:"ok",aSt:["VIEW HIGHSCORE?"],rtFun:function(_b)
- {
- if(_b)
- {
- Global.VIEWSCORE();
- }
- return true;
- }});
- };
- this._parent.remove();
- }
- else
- {
- _root.attachMovie("PopUp","PopUp" + _root.getNextHighestDepth(),_root.getNextHighestDepth(),{sFrame:"ok",aSt:["ENTER A NAME PLEASE!"]});
- }
- };
- break;
- case "message":
- this.nWidth = PopUp.nWidth_s;
- this.tT_0._x = 0;
- this.tT_0.tTxt._width = this.nWidth - PopUp.nOffset_x;
- this.tT_0.replace();
- this.nHeight = int(Math.max(PopUp.nHeight_s,this.tT_0.tTxt.textHeight + PopUp.nOffset_x * 2));
- this.tT_0._y = - int(PopUp.nOffset_x / 2 + this.tT_0.tTxt.textHeight / 2);
- }
- this.bt_X.release = function()
- {
- this._parent.rtFun(false);
- this._parent.remove();
- };
- this.mBar._width = this.nWidth;
- this.mBar._height = this.nHeight;
- this.mBar._x = (- this.nWidth) / 2;
- this.mBar._y = (- this.nHeight) / 2;
- this.stop();
- }
- function rtFun(_b)
- {
- return true;
- }
- function remove()
- {
- this.removeMovieClip();
- }
- }
-