Comunidad de diseño web y desarrollo en internet online

Problemas sin solucion, llevo 10 dias dandole vueltas.

Citar            
MensajeEscrito el 15 Dic 2008 11:07 pm
Antes de nada, saludar a todos y comentar que es un muy buenisimo foro.
Mi problema es el siguiente:
Compre una plantilla flash, para poder hacer una web, es muy bonita y asi me inicio en flash.
Esta pplantilla pilla los datos de un archico xml, que es el que edito para poner la información de mi web, pero
cuando pongo una ñ o algun acentos no se ve directamente.

He leido que si system.use code page true, que si la codificacion del xml en utf-8, que guardarlo en utf-8, incluso en incluido la codificacion que corresponde a ñ o a las vcales que necesitaba.

De verdad, ya no se que hacer, lo he intentado todo ( teniendo en cuenta mi nivel inicicacion de flash y actionscrip).
Por favor, necesito que alguien me eche una mano, si necesitais ke porga mi codigo del primer fotograma ( ke kreo ke es el primero) pues lo pondre, sin mas un cordial saludo y gracias.

Por koperniko

5 de clabLevel



 

firefox
Citar            
MensajeEscrito el 16 Dic 2008 03:29 am
Seria bueno que pases la parte de codigo donde se carga el XML y una parte del XML para tener de guia la estructura que tiene.

Por drarock

Claber

705 de clabLevel

3 tutoriales

Genero:Femenino  

Lima, Peru

msie7
Citar            
MensajeEscrito el 16 Dic 2008 12:25 pm
este es mi primer fotograma de flash

Código :

Stage.align = "MC";
Stage.scaleMode = "noScale";
url = "tfile";

_root.cacheKiller="true"; 
import gs.dataTransfer.XMLParser;
function onFinish(success_boolean, results_obj, xml) { //This fhunction gets called as soon as the XML loads and gets parsed.
   if (success_boolean) {
      //trace (1);
      play();
   }
}
stop();
var parsed_obj = {}; //We'll use this to hold the parsed xml object (once the XML loads and gets parsed successfully).
var unCash= new Date().getTime();
if (_root.cacheKiller=="true") {

   fileToLoad=url+"_main.xml?cacheKiller="+unCash;
   fileToLoad=url+"_main.xml";
}
else {
   fileToLoad=url+"_main.xml";
}
XMLParser.load(fileToLoad, onFinish, parsed_obj);



_root.emp.useHandCursor = 0;
///forplayer
_root.mus = 1;
_root.n = 1;
_root.num = 1;

Gracias por interesarte, heber si conseguimos solucionarlo porque me duele la cabeza ya jejeje

Por koperniko

5 de clabLevel



 

firefox
Citar            
MensajeEscrito el 16 Dic 2008 12:48 pm
¿La plantilla que compraste es en inglés? Si es así, es sumamente probable que los cuadros de texto dinámico no tengan embebidos los caracteres especiales propios del castellano. Selecciona un cuadro de texto (de los que te da problema) y ve si está seleccionado "Basic Latin" y los caracteres acentuados.

Por The Fricky!

Presidente

6168 de clabLevel

3 tutoriales
8 articulos

Genero:Masculino   Bastard Operators From Hell Héroes

Piccola Venezia...

firefox
Citar            
MensajeEscrito el 16 Dic 2008 01:40 pm
De verdad soy un inutil, jejejej estoy empezando con esto del flash profesional 8. No encuentro eso ke me dices.
Cuando casi encuentro algo parecido me sale abajo propiedades, filtro y parametros.
Dentro de la pestaña prpiedades no veo eso ke me dices, si puedes explikame mejor jejej, lo siento.

Por koperniko

5 de clabLevel



 

firefox
Citar            
MensajeEscrito el 16 Dic 2008 01:50 pm

  1. Mucho te agradecería que escribas correctamente ("que" en vez de "ke"). Hay que pensar en los bucadores y no cobramos por letra.
  2. No hay problema: Selecciona el cuadro de texto y verás a la derecha del panel propiedades un botón que dice "Embed" (no recuerdo cómo dice en castellano). Al hacerle clic te aparecerá un cuadro de diálogo con una lista de juegos de caracteres, ahí vas a buscar "Basic Latin".
  3. Y bueno, ya que dices que estás comenzando con Flash, entonces muy probablemente te vendría bien darle una mirada al Curso de Flash

Por The Fricky!

Presidente

6168 de clabLevel

3 tutoriales
8 articulos

Genero:Masculino   Bastard Operators From Hell Héroes

Piccola Venezia...

firefox
Citar            
MensajeEscrito el 16 Dic 2008 02:19 pm
Levas razón, escribire bien. He realizado lo que me has comentado, pero no hay manera, si necesitas el xml, o algo mas por favor pidemelo, es que ya no se que hacer.

Por koperniko

5 de clabLevel



 

firefox
Citar            
MensajeEscrito el 16 Dic 2008 02:25 pm
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.

Por koperniko

5 de clabLevel



 

firefox
Citar            
MensajeEscrito el 16 Dic 2008 04:15 pm
Bueno, lo sulucioné, efectivamente tenia que añadir en el campo de texto los caracteres que me hacian falta.
Un millón de gracias.

Por koperniko

5 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.