FLASHでの New Game Web のスコア登録処理の記述について

game.swf の場合
 

  1. FSCommandを使用
  2. getURLを使用




FSCommandを使用

HTML側
<SCRIPT Language="JavaScript" SRC="http://game.gr.jp/GameWeb/GameCenter/GRS0000000000/GRSmodule0000000000.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function game_DoFSCommand(command, args)
{
  var gameObj = InternetExplorer ? astrike : document.astrike;
  if( command=="j_score" )
  {
    GRS_score = args;
    GRS_sendScore();
  }
}

// Hook for Internet Explorer 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
   navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
 document.write('<SCRIPT LANGUAGE=VBScript\> \n');
 document.write('on error resume next \n');
 document.write('Sub game_FSCommand(ByVal command, ByVal args)\n');
 document.write('  call game_DoFSCommand(command, args)\n');
 document.write('end sub\n');
 document.write('</SCRIPT\> \n');
}
//-->
</SCRIPT>
 
 

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id=game
 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
 width=400 height=320>
<param name=movie value="game.swf">
<param name=bgcolor value=#000000>
<embed src="game.swf" name=game swLiveConnect=true bgcolor=#000000  width=400 height=320 type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</embed> 
</object>


 GRS0000000000/GRSmodule0000000000.js
  : NewGameWebへ作品を登録した時に、作品専用のファイル名が通知されます
 

 game
  : game.swf用の任意の識別子(ファイル中で一意であれば可)

  width=400 height=320
 game.swf
  : 作成したswfに応じて変更して下さい
 

※3行目以降はFLASHでHTMLテンプレートを「FSCOMMANDサポート」としてパブリッシュすると
 自動生成されます
 



FLASH側
FLASH側の処理です

  fscommand("j_score",""+score);

  score:FLASHでスコア格納に使用する変数(数値)
 




getURLを使用

HTML側
<SCRIPT Language="JavaScript" SRC="http://game.gr.jp/GameWeb/GameCenter/GRS0000000000/GRSmodule0000000000.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function j_score(args)
{
    GRS_score = args;
    GRS_sendScore();
}


 GRS0000000000/GRSmodule0000000000.js
  : NewGameWebへ作品を登録した時に、作品専用のファイル名が通知されます



FLASH側
FLASH側の処理です

  getURL("javascript:j_score("+score+");");

  score:FLASHでスコア格納に使用する変数(数値)
 


NewGameWebへ   作者HOME