我正在尝试编辑从 Flash 文件调用的 XML 文件,但我注意到某些字母没有显示出来,例如字母“q”和“j”。以下是 Flash 文件中的脚本:
var max_news_items = 5;
GetTitleText = function (news_xml, entry_index)
{
var _loc2 = news_xml.firstChild.childNodes;
var _loc1 = _loc2[entry_index].firstChild;
return (_loc1.firstChild.nodeValue);
};
GetBodyText = function (news_xml, entry_index)
{
var _loc2 = news_xml.firstChild.childNodes;
var _loc1 = _loc2[entry_index].firstChild.nextSibling;
return (_loc1.firstChild.nodeValue);
};
GetEntry = function (news_xml, index)
{
var _loc1 = news_xml.firstChild.childNodes;
return (_loc1[index]);
};
GetNewsCount = function (news_xml)
{
var _loc1 = news_xml.firstChild.childNodes;
return (_loc1.length);
};
ShowNews = function (news_xml)
{
if (!news_xml.firstChild.hasChildNodes())
{
content_txt.text = "No info. available.";
return (0);
} // end if
var _loc5 = news_xml.firstChild.childNodes;
content_txt.text = "";
for (var _loc1 = 0; _loc1 < _loc5.length; ++_loc1)
{
var _loc3 = GetTitleText(news_xml, _loc1);
var _loc2 = GetBodyText(news_xml, _loc1);
content_txt.htmlText = content_txt.htmlText + ("<u><b>" + _loc3 + "</b><br></u>");
content_txt.htmlText = content_txt.htmlText + (_loc2 + "<br><br>");
} // end of for
};
AddNewsEntry = function (news_xml, title, body)
{
var _loc2 = news_xml.createElement("entry");
if (title == "")
{
title = "";
} // end if
var _loc4 = news_xml.createElement("title");
var _loc7 = news_xml.createTextNode(title);
_loc4.appendChild(_loc7);
_loc2.appendChild(_loc4);
if (body == "")
{
body = "(none)";
} // end if
var _loc3 = news_xml.createElement("body");
var _loc6 = news_xml.createTextNode(body);
_loc3.appendChild(_loc6);
_loc2.appendChild(_loc3);
if (news_xml.firstChild.hasChildNodes())
{
news_xml.firstChild.insertBefore(_loc2, news_xml.firstChild.firstChild);
}
else
{
news_xml.firstChild.appendChild(_loc2);
} // end else if
while (GetNewsCount(news_xml) > max_news_items)
{
news_xml.firstChild.lastChild.removeNode();
} // end while
};
EditNewsEntry = function (news_xml, node_index, title, body)
{
var _loc1 = GetEntry(news_xml, node_index);
if (title == "" && body == "")
{
_loc1.removeNode();
return (0);
}
else
{
if (title == "")
{
title = "(none)";
} // end if
if (body == "")
{
body = "(none)";
} // end if
} // end else if
_loc1.attributes.date = new Date().toString();
var _loc4 = _loc1.firstChild.firstChild;
var _loc5 = _loc1.firstChild.nextSibling.firstChild;
_loc4.nodeValue = title;
_loc5.nodeValue = body;
};
SaveNews = function (news_xml)
{
content_txt.htmlText = "<i>Saving and Loading...</i>";
news_xml.xmlDecl = "";
news_xml.sendAndLoad(save_script, news_xml);
};
RefreshNews = function (news_xml)
{
content_txt.htmlText = "<i>Loading...</i>";
news_xml.load(xml_file + "?" + new Date().getTime());
};
var xml_file = "text_store/leasing.xml";
var save_script = "leasing_save.php";
var news_xml = new XML();
news_xml.ignoreWhite = true;
news_xml.contentType = "text/xml";
news_xml.onLoad = function (success)
{
if (success)
{
ShowNews(this);
}
else
{
content_txt.text = "Error loading Info.";
} // end else if
};
RefreshNews(news_xml);
老实说,我对 Flash 和 ActionScript 几乎一无所知,所以我不知道从哪里着手解决这个问题。任何帮助表示赞赏!