取得したXMLに含まれるitemの値を用いてサーバ上のPNGファイルを取得し,ステージ上に配置したムービークリップにロードする.
1.windowレイヤー上にムービークリップ(W90xH18の矩形)を配置(インスタンス名:item_mc)
2.取得したXMLに含まれるitemの値を用いて取得するファイル名を組み立てる
3.ファイルを取得し,ステージ上のムービークリップにロード
読み込まれるPNGファイル一覧
 |
1star.png |
 |
2star.png |
 |
3star.png |
 |
4star.png |
 |
5star.png |
サンプル
var user_name = "ユーザー名";
var user_pass = "パスワード";
status_xml = new XML();
status_xml.onLoad = userStatus;
status_xml.load("http://www14026u.sakura.ne.jp/ma/11/status.php?user_name='"+user_name+"'&user_pass='"+user_pass+"'");
status_xml.ignoreWhite = true;
function userStatus(success) {
if (success == true) {
money = status_xml.firstChild.firstChild.firstChild.firstChild.nodeValue
user = status_xml.firstChild.firstChild.firstChild.nextSibling.nextSibling.firstChild.nodeValue;
itemNum = status_xml.firstChild.firstChild.firstChild.nextSibling.firstChild.nodeValue;
item_mc.loadMovie("http://www14026u.sakura.ne.jp/ma/11/img/"+itemNum+"star.png");
}
}
0 件のコメント:
コメントを投稿