0
플래시 파일에서 호출되는 XML 파일을 편집하려고하는데 "q"와 "j"와 같은 특정 문자가 표시되지 않습니다. 여기에 플래시 파일에서 스크립트입니다문자가 XML에 나타나지 않습니다.
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);
솔직히거야, 나는 플래시와 액션에 대해 거의 아는, 그래서 나는이 문제를 해결하기 위해 시작 위치를 알 수 없습니다. 어떤 도움을 주셔서 감사합니다!