求大佬解释一下代码
flash吧
全部回复
仅看楼主
level 1
function onFinish(success_boolean, results_obj, xml)
{
if (success_boolean)
{
play ();
} // end if
} // End of the function
Stage.align = "MC";
Stage.scaleMode = "noScale";
url = "29007";
_root.cacheKiller = "true";
stop ();
var parsed_obj = {};
var unCash = new Date().getTime();
if (_root.cacheKiller == "true")
{
fileToLoad = url + "_main.xml?cacheKiller=" + unCash;
fileToLoad = url + "_main.xml";
}
else
{
fileToLoad = url + "_main.xml";
} // end else if
gs.dataTransfer.XMLParser.load(fileToLoad, onFinish, parsed_obj);
_root.emp.useHandCursor = 0;
_root.mus = 1;
_root.n = 1;
_root.num = 1;
2020年05月13日 12点05分 1
level 1
function onFinish(success_boolean, gallery_obj, xml)
{
if (success_boolean)
{
play ();
} // end if
} // End of the function
function textSelectable(selectedObject)
{
isTextSelected = getSettingsValue(mainObj, "textSelectable", "item");
if (isTextSelected == "true")
{
selectedObject.selectable = true;
} // end if
} // End of the function
function getXmlSection(obj, itemName, sectionName)
{
for (i = 0; obj[itemName][i]; i++)
{
if (obj[itemName][i].name == sectionName)
{
returnedResult = true;
return (i);
break;
} // end if
} // end of for
} // End of the function
function getSettingsValue(obj, itemName, itemType)
{
sectionNum = getXmlSection(obj, "section", "settings");
for (k = 0; obj.section[sectionNum][itemType][k]; k++)
{
if (obj.section[sectionNum][itemType][k].name == itemName)
{
return (obj.section[sectionNum][itemType][k].value);
break;
} // end if
} // end of for
} // End of the function
function getCopyright(textObj)
{
textObj.htmlText = getSettingsValue(mainObj, "copyright", "item");
textSelectable(textObj);
} // End of the function
function getCompanyName(textObj)
{
textObj.htmlText = getSettingsValue(mainObj, "companyName", "item");
textSelectable(textObj);
} // End of the function
function getSlogan(textObj)
{
textObj.htmlText = getSettingsValue(mainObj, "slogan", "item");
textSelectable(textObj);
} // End of the function
function getSystemValue(textObj, systemOptionName)
{
textObj.htmlText = getSettingsValue(mainObj, systemOptionName, "item");
textSelectable(textObj);
} // End of the function
2020年05月13日 12点05分 2
level 1
function getMenuLink(textObj, linkNum)
{
sectionNum = getXmlSection(mainObj, "section", "menu");
textObj.htmlText = mainObj.section[sectionNum].link[linkNum].value;
textSelectable(textObj);
} // End of the function
function getMenuSystemOrder(linkNum)
{
sectionNum = getXmlSection(mainObj, "section", "menu");
return (mainObj.section[sectionNum].link[linkNum].systemOrder);
} // End of the function
function getCurrentText(textObj, textNumber)
{
sectionNum = getXmlSection(mainObj, "section", "pages");
currentPage = _root.link - _root.firstPageFrame;
textObj.htmlText = mainObj.section[sectionNum].page[currentPage].texts[0].pageText[textNumber].value;
textSelectable(textObj);
} // End of the function
function getGlobalText(textObj, textsNumber, optional)
{
sectionNum = getXmlSection(mainObj, "section", "global_text");
textObj.htmlText = mainObj.section[sectionNum].texts[textsNumber].value;
if (optional == undefined)
{
textSelectable(textObj);
} // end if
} // End of the function
function getGlobalImageName(imageNumber)
{
sectionNum = getXmlSection(mainObj, "section", "global_img");
currentPage = _root.link - _root.firstPageFrame;
imageParams = new Array();
imageParams.name = mainObj.section[sectionNum].image[imageNumber].imageUrl;
imageParams.linkToOpen = mainObj.section[sectionNum].image[imageNumber].link;
return (imageParams);
} // End of the function
function getMenuPreviousLink(linkNum)
{
k = 0;
for (systemOrder = getMenuSystemOrder(k); systemOrder; systemOrder = getMenuSystemOrder(k))
{
if (systemOrder == linkNum)
{
orderResult = k + 1;
break;
} // end if
++k;
} // end of for
return (orderResult);
} // End of the function
function getCurrentImageName(imageNumber)
{
sectionNum = getXmlSection(mainObj, "section", "pages");
currentPage = _root.link - _root.firstPageFrame;
imageParams = new Array();
imageParams.name = mainObj.section[sectionNum].page[currentPage].image[imageNumber].imageUrl;
imageParams.linkToOpen = mainObj.section[sectionNum].page[currentPage].image[imageNumber].link;
imageParams.target = mainObj.section[sectionNum].page[currentPage].image[imageNumber].target;
return (imageParams);
} // End of the function
function getCurrentImageName_splash(imageNumber)
{
sectionNum = getXmlSection(mainObj, "section", "settings");
imageParams = new Array();
imageParams.name = mainObj.section[sectionNum].image[imageNumber].imageUrl;
imageParams.linkToOpen = mainObj.section[sectionNum].image[imageNumber].link;
return (imageParams);
} // End of the function
function checkLinkType(linkTextType, linkNumber)
{
k = 0;
typeCount = 0;
finalLinkNumber = parseInt(linkNumber) + 1;
currentPage = _root.link - _root.firstPageFrame;
sectionNum = getXmlSection(mainObj, "section", "pages");
for (linkTypeCkeck = mainObj.section[sectionNum].page[currentPage].link[k].linkType; linkTypeCkeck; linkTypeCkeck = mainObj.section[sectionNum].page[currentPage].link[k].linkType)
{
if (linkTypeCkeck == linkTextType)
{
++typeCount;
} // end if
if (typeCount == finalLinkNumber)
{
return (k);
break;
} // end if
++k;
} // end of for
} // End of the function
function more_click_func(number)
{
num = _root.pagesReadMoreFrame;
currentPage = _root.link - _root.firstPageFrame;
if (isNaN(Number(number)))
{
tempNumber = number.split(" ");
number = tempNumber.join("");
readMoreType = String(number).toLowerCase();
}
else
{
readMoreType = "readmore";
} // end else if
2020年05月13日 12点05分 3
level 1
if ((_root.link != num || _root.readMoreFrameType != readMoreType) && _root.animation == 1)
{
_root.animation = 0;
_root.link_prev = _root.link;
_root.menu["item" + getMenuPreviousLink(_root.link)].gotoAndPlay("s2");
_root.menu2["item" + getMenuPreviousLink(_root.link)].gotoAndPlay("s2");
if (readMoreType == "privacypolicy")
{
_root.readMoreFrameType = "privacypolicy";
sectionNum = getXmlSection(mainObj, "section", "privacyPolicy");
titleNum = getXmlSection(mainObj.section[sectionNum], "item", "pageTitle");
textNum = getXmlSection(mainObj.section[sectionNum], "item", "pageText");
_root.readMoreTitle = mainObj.section[sectionNum].item[titleNum].value;
_root.readMoreText = mainObj.section[sectionNum].item[textNum].value;
}
else if (readMoreType == "termsofuse")
{
_root.readMoreFrameType = "termsofuse";
sectionNum = getXmlSection(mainObj, "section", "termsOfUse");
titleNum = getXmlSection(mainObj.section[sectionNum], "item", "pageTitle");
textNum = getXmlSection(mainObj.section[sectionNum], "item", "pageText");
_root.readMoreTitle = mainObj.section[sectionNum].item[titleNum].value;
_root.readMoreText = mainObj.section[sectionNum].item[textNum].value;
}
else
{
_root.readMoreFrameType = "readmore";
sectionNum = getXmlSection(mainObj, "section", "pages");
linkCount = checkLinkType("readMoreLink", number);
i = 0;
linkTitleNum = getXmlSection(mainObj.section[sectionNum].page[currentPage].link[linkCount], "item", "title");
linkTextNum = getXmlSection(mainObj.section[sectionNum].page[currentPage].link[linkCount], "item", "linkText");
_root.readMoreTitle = mainObj.section[sectionNum].page[currentPage].link[linkCount].item[linkTitleNum].value;
_root.readMoreText = mainObj.section[sectionNum].page[currentPage].link[linkCount].item[linkTextNum].value;
} // end else if
_root.link = num;
_root.play();
} // end if
} // End of the function
function getContactFormText(textObj, textNumber)
{
sectionNum = getXmlSection(mainObj, "section", "contactForm");
textObj.htmlText = mainObj.section[sectionNum].texts[0].pageText[textNumber].value;
textSelectable(textObj);
} // End of the function
function getContactFormText_only(textNumber)
{
sectionNum = getXmlSection(mainObj, "section", "contactForm");
return (htmlText = mainObj.section[sectionNum].texts[0].pageText[textNumber].value);
} // End of the function
function getContactFormParams()
{
sectionNum = getXmlSection(mainObj, "section", "contactForm");
ContactFormParams = new Array();
servNum = getXmlSection(mainObj.section[sectionNum], "item", "serverOption");
recNum = getXmlSection(mainObj.section[sectionNum], "item", "recipient");
ContactFormParams.rec = mainObj.section[sectionNum].item[recNum].value;
ContactFormParams.serv = mainObj.section[sectionNum].item[servNum].value;
return (ContactFormParams);
} // End of the function
function getGallerySystemProperty(propName)
{
sectionNum = getXmlSection(galleryObj, "section", "systemOptions");
propNum = getXmlSection(galleryObj.section[sectionNum], "option", propName);
return (galleryObj.section[sectionNum].option[propNum].value);
} // End of the function
function getGallerySettings(propName)
{
sectionNum = getXmlSection(galleryObj, "section", "settings");
propNum = getXmlSection(galleryObj.section[sectionNum], "option", propName);
return (galleryObj.section[sectionNum].option[propNum].value);
} // End of the function
function getGalleryImage(imageNum, categoryNum)
{
sectionNum = getXmlSection(galleryObj, "section", "imagesData");
imageParams = new Array();
image = galleryObj.section[sectionNum].category[categoryNum].image[imageNum];
nameNum = getXmlSection(image, "item", "imageUrl");
commentNum = getXmlSection(image, "item", "imageComment");
imageParams.name = image.item[nameNum].value;
imageParams.comment = image.item[commentNum].value;
return (imageParams);
} // End of the function
function getCurrentGalleryName(categoryNum)
{
sectionNum = getXmlSection(galleryObj, "section", "imagesData");
return (galleryObj.section[sectionNum].category[categoryNum].name);
} // End of the function
searchResultsFrame = 8;
pagesReadMoreFrame = 7;
firstPageFrame = 1;
var mainObj = _root.parsed_obj;
var galleryObj = _root.gallery_obj;
_root.readMoreFrameType = "readmore";
2020年05月13日 12点05分 4
1