次のような3075のエントリを持つxmlファイルがあります
<item id="1" itype="COLOUR"></item>
アクション スクリプト 2 を使用して xml をロードし、while ループでこのコードを使用してすべてのデータを配列に入力します。
my_xml = new XML();
paper_crumbs = Array();
my_xml.load("sample.xml");
my_xml.onLoad = my_function;
my_xml.ignoreWhite = 1;
function my_function() {
var b = true;
var num = "1";
while(b == true){
paper_crumbs[my_xml.firstChild.childNodes[num].attributes.id] = {type: my_xml.firstChild.childNodes[num].attributes.itype, cost: 0, is_member: false};
if(my_xml.firstChild.childNodes[num].attributes.final == "yes"){
b = false;
trace("done");
}
num = num + 1;
}
}
私が抱えている問題は、フラッシュが応答しなくなり、スクリプトを終了するかどうかを尋ねることです.xmlをループして配列に追加するか、誰かがwhileを編集して動作させることができる他の方法はありますか?