2 // グローバル名前空間にmainManagerがすでに存在する状況下で呼ばれる。
3 // 最初の行で新たなインスタンスを生成し、最後のreturnでそれを返す。
5 stage = new GameStage();
8 stage.runStage = function(){
9 //元々定義されていた、疑似スーパークラス(prototype)の関数を呼び出す。
10 GameStage.prototype.runStage.apply(this, []);
11 this.authform = createDOMObject("form", "authform", "MainArea");
12 this.authform.style.zIndex = 4;
13 this.authform.style.position = "absolute";
14 this.authform.style.top = "300px";
15 this.authform.style.left = "80px";
16 this.authform.onsubmit = function () { this.submitAuth; return false;};
17 this.authform.innerHTML = "ユーザー名:<input id='authUserName' type='text' name='userName' style='z-index:6' size='50'/>";
18 this.authform.innerHTML += "<input id='authSubmitButton' type='button' value='ログイン'>";
19 this.authSubmitButton = document.getElementById("authSubmitButton");
20 this.authSubmitButton.onclick = this.submitAuth;
21 this.background = createImage("title.jpg");
22 this.manager.setBackgroundMusic("007.mp3");
24 stage.submitAuth = function(){
25 mainManager.userManager.loginAs(mainManager.runningStage.authform.userName.value);
26 return false; //常に送信しない。
29 stage.stopStage = function(){
30 destroyDOMObjectByID("authform");
31 //元々定義されていた、疑似スーパークラス(prototype)の関数を呼び出す。
32 GameStage.prototype.stopStage.apply();