Это мой внешний XML-файл db.xmlКак обновить внешний файл XML с помощью AS3?
<?xml version="1.0" encoding="utf-8"?>
<character>
<main hp="50" lvl="1" dmg="5" def="5" exp="100.00" gold="10"/>
</character>
В этой части я хочу, что текущее значение каждого обновляется.
function clickLvl(e:MouseEvent):void
{
trace("lvl is clicked!");
//increment values - works fine
[email protected] = int([email protected]) + 1;
[email protected] = int([email protected]) + 10;
[email protected] = int([email protected]) + 5;
[email protected] = int([email protected]) + 5;
this.lvlDis.text = String([email protected]);
this.hpDis.text = String([email protected]);
this.dmgDis.text = String([email protected]);
this.defDis.text = String([email protected]);
this.expDis.text = String([email protected]);
this.goldDis.text = String([email protected]);
// save/update the values in .xml
/*
CODE HERE :D
*/
}
Значения обновляются, когда я запускаю SWF-файл, но когда я закрываю и открываю его, значения не сохраняются. Как я могу обновить/сохранить значение в моем xml?