var _num;
function OnLoadFinished() {
_num = 0;
var SiblingItemID = SGWorld.ProjectTree.GetNextItem(0, 11);
if (SiblingItemID == 0) {
return;
}
while (SiblingItemID > 0) {
if (SGWorld.ProjectTree.IsGroup(SiblingItemID) > 0) {
TraverseBranch(SiblingItemID);
}
else {
var _item = SGWorld.ProjectTree.GetObject(SiblingItemID);
if (_item.Message.MessageID != "0_-1") {
var _item2 = SGWorld.Creator.GetObject(_item.Message.MessageID);
ModifyURL(_item2);
}
}
SiblingItemID = SGWorld.ProjectTree.GetNextItem(SiblingItemID, 13);
}
alert("共修改 " + _num.toString() + " ......");
}
function ModifyURL(_item) {
var text1 = document.getElementById("Text1");
m_OldURLPath = text1.value;
var text2 = document.getElementById("Text2");
m_NewURLPath = text2.value;
if (_item != null) {
if ((_item.Src != "") && (_item.Src.indexOf(m_OldURLPath)>0)) {
var reg = new RegExp(m_OldURLPath,"g");//創建正則RegExp對象
_item.Src = _item.Src.replace(reg, m_NewURLPath);
_num = _num + 1;
}
}
}