Tambien hay dentro de la carpeta de la plantilla una carpeta gs/dataTransfer, y dentro de esta ruta dos archivos actionscript, uno se llama xmlFunctions.as y el otro XMLParser.as, los pongo aqui y los miras haber si hay esta el problema.
xmlFunctions.as
Código :
var mainObj=_root.parsed_obj;
var galleryObj=_root.gallery_obj;
function textSelectable(selectedObject) {
isTextSelected=getSettingsValue(mainObj, "textSelectable", "item");
if (isTextSelected=="true") {
selectedObject.selectable=true;
}
}
function getXmlSection (obj, itemName, sectionName) {
i=0;
while (obj[itemName][i]) {
if (obj[itemName][i].name==sectionName) {
returnedResult=true;
return (i);
break;
}
i++;
}
}
function getSettingsValue (obj, itemName, itemType) {
sectionNum=getXmlSection(obj, "section", "settings");
k=0;
while (obj["section"][sectionNum][itemType][k]) {
if (obj["section"][sectionNum][itemType][k].name==itemName) {
return (obj.section[sectionNum][itemType][k].value);
break;
}
k++;
}
}
function getCopyright (textObj) {
textObj.htmlText=getSettingsValue(mainObj, "copyright", "item");
textSelectable(textObj);
}
function getCompanyName (textObj) {
textObj.htmlText=getSettingsValue(mainObj, "companyName", "item");
textSelectable(textObj);
}
function getSlogan (textObj) {
textObj.htmlText=getSettingsValue(mainObj, "slogan", "item");
textSelectable(textObj);
}
function getSystemValue (textObj, systemOptionName) {
textObj.htmlText=getSettingsValue(mainObj, systemOptionName, "item");
textSelectable(textObj);
}
function getMenuLink (textObj, linkNum) {
sectionNum=getXmlSection(mainObj, "section", "menu");
textObj.htmlText=mainObj["section"][sectionNum].link[linkNum].value;
textSelectable(textObj);
}
function getMenuSystemOrder (linkNum) {
sectionNum=getXmlSection(mainObj, "section", "menu");
return (mainObj["section"][sectionNum].link[linkNum].systemOrder);
}
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);
}
function getMenuPreviousLink (linkNum) {
k=0;
systemOrder=getMenuSystemOrder(k);
while (systemOrder) {
if (systemOrder==linkNum) {
orderResult=k+1;
break;
}
k++;
systemOrder=getMenuSystemOrder(k);
}
return (orderResult);
}
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);
}
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);
}
function checkLinkType (linkTextType, linkNumber) {
k=0;
typeCount=0;
finalLinkNumber=parseInt(linkNumber)+1;
currentPage=_root.link-_root.firstPageFrame;
sectionNum=getXmlSection(mainObj, "section", "pages");
linkTypeCkeck=mainObj["section"][sectionNum]["page"][currentPage]["link"][k]["linkType"];
while (linkTypeCkeck){
if (linkTypeCkeck==linkTextType) {
typeCount++;
}
if (typeCount==finalLinkNumber) {
return(k);
break;
}
k++;
linkTypeCkeck=mainObj["section"][sectionNum]["page"][currentPage]["link"][k]["linkType"];
}
}
_root.readMoreFrameType = 'readmore';
function more_click_func(number) {
tempNumber = number.split(" ");
number=tempNumber.join("");
number=number.toLowerCase();
num=_root.pagesReadMoreFrame;
currentPage=_root.link-_root.firstPageFrame;
if( isNaN(Number(number)) ) {
readMoreType = number;
} else {
readMoreType = 'readmore';
}
if( (_root.link<>num || _root.readMoreFrameType!=readMoreType) and _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 (number=='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 (number=='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;
}
_root.link=num;
_root.play();
}
}
function getContactFormText(textObj, textNumber) {
sectionNum=getXmlSection(mainObj, "section", "contactForm");
textObj.htmlText=mainObj["section"][sectionNum]["texts"][0]["pageText"][textNumber].value;
textSelectable(textObj);
}
function getContactFormText_only(textNumber) {
sectionNum=getXmlSection(mainObj, "section", "contactForm");
return htmlText=mainObj["section"][sectionNum]["texts"][0]["pageText"][textNumber].value;
}
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);
}
// gallery functions
function getGallerySystemProperty(propName) {
sectionNum=getXmlSection(galleryObj, "section", "systemOptions");
propNum=getXmlSection(galleryObj["section"][sectionNum], "option", propName);
return (galleryObj["section"][sectionNum]["option"][propNum].value);
}
function getGallerySettings(propName) {
sectionNum=getXmlSection(galleryObj, "section", "settings");
propNum=getXmlSection(galleryObj["section"][sectionNum], "option", propName);
return (galleryObj["section"][sectionNum]["option"][propNum].value);
}
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);
}
function getCurrentGalleryName(categoryNum) {
sectionNum=getXmlSection(galleryObj, "section", "imagesData");
return (galleryObj["section"][sectionNum]["category"][categoryNum].name);
}Y el script XMLParser.as
Código :
import mx.utils.Delegate;
class gs.dataTransfer.XMLParser {
static var CLASS_REF = gs.dataTransfer.XMLParser;
private static var _parsers_array:Array;
private var _url_str:String;
private var _onComplete_func:Function;
private var _xml:XML;
private var _results_obj:Object;
var parse:Function; //Just for backward compatibility. It's essentially an alias pointing to the initLoad() function.
function XMLParser() {
parse = initLoad; //Just for backward compatibility. It's essentially an alias pointing to the initLoad() function.
if (_parsers_array == undefined) {
_parsers_array = [];
}
_parsers_array.push(this);
}
static function load(url_str:String, onComplete_func:Function, results_obj:Object):XMLParser {
var parser_obj = new XMLParser();
parser_obj.initLoad(url_str, onComplete_func, results_obj);
return parser_obj;
}
static function sendAndLoad(toSend_obj:Object, url_str:String, onComplete_func:Function, results_obj:Object):XMLParser {
var parser_obj = new XMLParser();
parser_obj.initSendAndLoad(toSend_obj, url_str, onComplete_func, results_obj);
return parser_obj;
}
function initLoad(url_str:String, onComplete_func:Function, results_obj:Object) {
if (results_obj == undefined) {
results_obj = {};
}
_results_obj = results_obj;
_url_str = url_str;
_onComplete_func = onComplete_func;
_xml = new XML();
_xml.ignoreWhite = true;
_xml.onLoad = Delegate.create(this, this.parseLoadedXML);
_xml.load(_url_str);
}
function initSendAndLoad(toSend_obj:Object, url_str:String, onComplete_func:Function, results_obj:Object) {
if (results_obj == undefined) {
results_obj = {};
}
_results_obj = results_obj;
_url_str = url_str;
_onComplete_func = onComplete_func;
if (toSend_obj instanceof XML) {
var xmlToSend_obj = toSend_obj;
} else {
var xmlToSend_obj = XMLParser.objectToXML(toSend_obj);
}
_xml = new XML();
_xml.ignoreWhite = true;
_xml.onLoad = Delegate.create(this, this.parseLoadedXML);
xmlToSend_obj.sendAndLoad(_url_str, _xml);
}
function searchAndReplace(holder, searchfor, replacement) {
var temparray = holder.split(searchfor);
var holder = temparray.join(replacement);
return (holder);
}
private function parseLoadedXML(success_boolean) {
if (success_boolean == false) {
trace("XML FAILED TO LOAD! ("+_url_str+")");
_onComplete_func(false);
return;
}
var x = this._xml;
var c = x.firstChild.firstChild; //"c" is for current_node
var last_node = x.firstChild.lastChild;
x.firstChild.obj = _results_obj; //Allows us to tack on all the arrays and objects to this instance for easy retrieval by the user. If this causes a problem, we could create a public object variable that holds everything, but this simplifies things for the user.
while(c != undefined) {
//We ran into an issue where Flash was creating an extra subnode anytime we had content in a node like <NODE>My Content</NODE>. The tip off is when the nodeName is null and the nodeType is 3 (text).
if (c.nodeName == null && c.nodeType == 3) {
c.parentNode.obj.value = searchAndReplace(c.nodeValue, '\r\n', '');
} else {
var o = {};
for (var att in c.attributes) {
o[att] = c.attributes[att];
}
var pn = c.parentNode.obj;
if (pn[c.nodeName] == undefined) {
pn[c.nodeName] = [];
}
c.obj = o;
pn[c.nodeName].push(o);
}
if (c.childNodes.length > 0) {
c = c.childNodes[0];
} else {
var next_node = c;
while(next_node.nextSibling == undefined && next_node.parentNode != undefined) {
next_node = next_node.parentNode;
}
c = next_node.nextSibling;
if (next_node == last_node) {
c = undefined;
}
}
}
_onComplete_func(true, _results_obj, x);
}
//Allows us to translate an object (typically with arrays attached to it) back into an XML object. This is useful when we need to send it back to the server or save it somewhere.
public static function objectToXML(o:Object, rootNodeName_str:String):XML {
if (rootNodeName_str == undefined) {
rootNodeName_str = "XML";
}
var xml:XML = new XML();
var n:XMLNode = xml.createElement(rootNodeName_str);
var props = [];
var prop;
for (var p in o) {
props.push(p);
}
for (var p = props.length - 1; p >= 0; p--) { //By default, attributes are looped through in reverse, so we go the opposite way to accommodate for this.
prop = props[p];
if (typeof(o[prop]) == "object" && o[prop].length > 0) { //Means it's an array!
arrayToNodes(o[prop], n, xml, prop);
} else if (prop == "value") {
var tn:XMLNode = xml.createTextNode(o.value);
n.appendChild(tn);
} else {
n.attributes[prop] = o[prop];
}
}
xml.appendChild(n);
return xml;
}
//Recursive function that walks through any sub-arrays as well...
private static function arrayToNodes(ar:Array, parentNode:XMLNode, xml:XML, nodeName_str:String):Void {
var chldrn = [];
var props:Array;
var prop;
var n:XMLNode;
var o:Object;
for (var i = ar.length - 1; i >= 0; i--) {
n = xml.createElement(nodeName_str);
o = ar[i];
props = [];
for (var p in o) {
props.push(p);
}
for (var p = props.length - 1; p >= 0; p--) { //By default, attributes are looped through in reverse, so we go the opposite way to accommodate for this.
prop = props[p];
if (typeof(o[prop]) == "object" && o[prop].length > 0) { //Means it's an array!
arrayToNodes(o[prop], n, xml, prop);
} else if (prop != "value") {
n.attributes[prop] = o[prop];
} else {
var tn:XMLNode = xml.createTextNode(o.value);
n.appendChild(tn);
}
}
chldrn.push(n);
//parentNode.appendChild(n);
}
for (var i = chldrn.length - 1; i >= 0; i--) {
parentNode.appendChild(chldrn[i]);
}
}
public function destroy():Void {
delete _xml;
for (var i = 0; i < _parsers_array.length; i++) {
if (this == _parsers_array[i]) {
_parsers_array.splice(i, 1);
}
}
destroyInstance(this);
}
static function destroyInstance(i:XMLParser):Void {
delete i;
}
//---- GETTERS / SETTERS --------------------------------------------------------------------
static function get active_boolean():Boolean {
if (_parsers_array.length > 0) {
return true;
} else {
return false;
}
}
}
Comentame si es aquí donde tengo que modificar o corregir algo, gracias.