--- /dev/null
+Tips
+
+<Javascript Tips>
+document.getElementById("main").style.display = "none";
+(mainというIDが振られている要素の表示を消す)
+this.effectSound.pause();
+this.effectSound.currentTime = 0;
+this.effectSound.play();
+this.backgroundImage = new Image();
+this.backgroundMusic = document.getElementById('BGM006');
+this.effectSound = document.getElementById('SE_Select');
+
+<画像読み込み>
+this.backgroundImage.manager = this;
+this.backgroundImage.onload = this.backgroundLoaded;
+this.backgroundImage.src = "title.gif";
+
+<音楽再生>
+this.backgroundMusic.loop = true;
+this.backgroundMusic.play();
+
+<IE>
+-MicrosoftInternetExplorerでは、ローカル変数でparentを使うとappendChildが使えなくなる…。
+-囲まれたブロックの後の末尾部分が実行されない???
+ loadStageFromNetwork: function(name){
+ //URL_PCD_Stage/name.jsを利用してステージを作成する。
+ request = this.networkManager.CreateRequestObject();
+ //同期モード
+ request.open('GET', URL_PCD_Stage + name + ".js", false);
+ this.networkManager.RequestObjectDisableCache(request);
+ request.send(null);
+
+ if(request.status == 0){
+ alert("ネットワークにアクセスできません。" + request.status + ":" + request.statusText);
+ }else if((200 <= request.status && request.status < 300) || (request.status == 304)){
+ var stage = eval(request.responseText);
+ mainManager.runStage(stage);
+ }else{
+ alert("サーバーがエラーを返しました。" + request.status + ":" + request.statusText);
+ }
+ //なんで実行されないの????
+ alert("1564426");
+ },
+--以下のコードで解決できる。どこでも良いので実行させる。http://qiita.com/rev84/items/f7ca6a2af00daefa065c
+//IE fix
+if (!window.console){
+ window.console = {
+ log : function(msg){
+ // do nothing.
+ }
+ };
+}
+
+IEではXMLHTTPRequest.onreadystatechangeのthisの値が他と異なるようだ。
+なので、
+request.onreadystatechange = function(){
+ と無名関数で書いて、内部でrequestインスタンスを参照
+};
+しないとうまく動かない。
+++ /dev/null
-Tips
-
-<Javascript Tips>
-document.getElementById("main").style.display = "none";
-(mainというIDが振られている要素の表示を消す)
-this.effectSound.pause();
-this.effectSound.currentTime = 0;
-this.effectSound.play();
-this.backgroundImage = new Image();
-this.backgroundMusic = document.getElementById('BGM006');
-this.effectSound = document.getElementById('SE_Select');
-画像読み込み
-this.backgroundImage.manager = this;
-this.backgroundImage.onload = this.backgroundLoaded;
-this.backgroundImage.src = "title.gif";
-
-音楽再生
-this.backgroundMusic.loop = true;
-this.backgroundMusic.play();
-
-MicrosoftInternetExplorerでは、ローカル変数でparentを使うとappendChildが使えなくなる…。
-
-IEではXMLHTTPRequest.onreadystatechangeのthisの値が他と異なるようだ。
-なので、
-request.onreadystatechange = function(){
- と無名関数で書いて、内部でrequestインスタンスを参照
-};
-しないとうまく動かない。
//定数
//
-var URL_PCD_Root = "http://localhost/pcd2013dev/www/";
+//var URL_PCD_Root = "http://localhost/pcd2013dev/www/";
//var URL_PCD_Root = "http://192.168.6.242/pcd2013dev/www/";
-//var URL_PCD_Root = "http://192.168.0.3/PCD2013GSCL/www/";
+var URL_PCD_Root = "http://192.168.0.3/PCD2013GSCL/www/";
//var URL_PCD_Root = "http://192.168.6.242/pcd2013hikarupsp/pcd2013dev/www/";
var URL_PCD_Auth = URL_PCD_Root + "auth.php";
var URL_PCD_Audio = URL_PCD_Root + "audio/";
}
},
addWidghet: function(w){
- w.attached();
this.runningWidghets.push(w);
},
runStage: function(stage){
}
//runningStageに登録することで、イベントの通知が開始され、GameStageは実行状態に入る。
- this.runningStage = stage;
+ mainManager.runningStage = stage;
},
pauseStage: function(func){
//ステージの実行を一時停止する。一時停止中、funcに指定された関数が毎tick毎に呼ばれる
request.open('GET', URL_PCD_Stage + name + ".js", false);
this.networkManager.RequestObjectDisableCache(request);
request.send(null);
+
if(request.status == 0){
alert("ネットワークにアクセスできません。" + request.status + ":" + request.statusText);
}else if((200 <= request.status && request.status < 300) || (request.status == 304)){
}else{
alert("サーバーがエラーを返しました。" + request.status + ":" + request.statusText);
}
+ //なんでここ以下の文がIEでは実行されないの????
+ //
},
debugOut: function(str){
if(this.isIE)
dobj.id = idstr;
parentObj.appendChild(dobj);
+ for(;;){
+ if(document.getElementById(idstr)){
+ break;
+ }
+ }
+
return dobj;
}
document.write("<script type='text/javascript' src='corelib/classes/CharacterClass.js'></script>");
document.write("<script type='text/javascript' src='corelib/classes/OperatedCharacterClass.js'></script>");
document.write("<script type='text/javascript' src='corelib/classes/MainCharacterClass.js'></script>");
+//IE fix
+if (!window.console){
+ window.console = {
+ log : function(msg){
+ // do nothing.
+ }
+ };
+}
this.authform.innerHTML += "<input id='authSubmitButton' type='button' value='ログイン'>";
this.authSubmitButton = document.getElementById("authSubmitButton");
this.authSubmitButton.onclick = this.submitAuth;
-console.log("init");
};
stage.submitAuth = function(){
request = mainManager.networkManager.CreateRequestObject();
alert("サーバーがエラーを返しました。");
//console.log("NAK");
}
-return false; //常に送信しない。
+ return false; //常に送信しない。
};
stage.stopStage = function(){