AS 1/2 を使用して xml データに基づいて状態マップに色を付ける swfs がいくつかあります。これは数年間うまくいきましたが、現在xmlファイルが更新されています。swfs は新しい情報をロードしません。彼らはかつてそれをやったようで、今では石になっています。1 週間検索して、いくつかのキャッシュ バスターを試しましたが、どれも機能しませんでした。私が試したことのほとんどは、日付/時刻スタンプを xml ロード ステートメントに追加することに基づいていました。これらは効果がないか、アプリケーションを壊しました。コードは次のとおりです。
var dp = new Array();
dp_xml = new XML();
dp_xml.ignoreWhite = true;
dp_xml.load('dplaws.xml');
dp_xml.onLoad = function(sucess) {
if (sucess) {
parseFile(dp_xml);
showArray();
}
};
function Map(state, category, qid, question, response) {
this.state = state;
this.category = category;
this.qid = qid;
this.question = question;
this.response = response;
if((substring(response,1,3)=="Yes") && (qid == "b")) {
myColor = new Color(state);
myColor.setRGB(0xA2B5CD);
} else if((substring(response,1,3)!="Yes") && (qid == "b")) {
myColor = new Color(state);
myColor.setRGB(0xcccccc);
}
}
function parseFile(xmlDoc_xml) {
temp = new Array();
for (var a = 0; a<xmlDoc_xml.firstChild.childNodes.length; a++) {
for (var b = 0; b<xmlDoc_xml.firstChild.firstChild.childNodes.length; b++) {
temp[b] = xmlDoc_xml.firstChild.childNodes[a].childNodes[b].firstChild.nodeValue;
}
n = new Map(temp[0], temp[1], temp[2], temp[3], temp[4]);
dp.push(n);
}
}
function showArray(){
for (var z = 0; z<dp.length; z++) {
trace(dp[z].state);
trace(dp[z].category);
trace(dp[z].question);
trace(dp[z].response);
trace(dp[z].qid);
}
}
助けてくれてありがとう、デビー