Foros del Web » Creando para Internet » Flash y Actionscript »

Las animaciones Flash no me muestran los caracteres con acentos (Español)

Estas en el tema de Las animaciones Flash no me muestran los caracteres con acentos (Español) en el foro de Flash y Actionscript en Foros del Web. Estoy nuevo en Flash y me encuentro con el problema, de que al leer datos desde xml, no aparecen las letras acentuadas, es decir, los ...
  #1 (permalink)  
Antiguo 17/01/2010, 20:05
jcl
 
Fecha de Ingreso: enero-2002
Mensajes: 673
Antigüedad: 22 años, 3 meses
Puntos: 1
Las animaciones Flash no me muestran los caracteres con acentos (Español)

Estoy nuevo en Flash y me encuentro con el problema, de que al leer datos desde xml, no aparecen las letras acentuadas, es decir, los texto en español no se leen bien.

Entiendo que es un problema que quizás ya se haya tratado aquí, pero en virtud a que son muchos los temas, no sabría por donde comenzar.

El buscador de este foro no me arrojó nada cuando ingresé “xml español”.

Por favor, ¿alguien podría darme alguna pista que me ayude a canalizar esté problema?

No se si es un asunto de Flash, o si por el contrario es simplemente de xml, o tal vez de ambas herramientas.

Gracias de antemano.
  #2 (permalink)  
Antiguo 18/01/2010, 09:26
Avatar de CESAR7  
Fecha de Ingreso: enero-2010
Mensajes: 20
Antigüedad: 14 años, 3 meses
Puntos: 3
Respuesta: Las animaciones Flash no me muestran los caracteres con acentos (Español)

igual yo tengo el mismo problema compre un template y ya lo edite aregle todo pero a la hora de poner algo con ( ñ ) no me lo lee
  #3 (permalink)  
Antiguo 18/01/2010, 09:47
jcl
 
Fecha de Ingreso: enero-2002
Mensajes: 673
Antigüedad: 22 años, 3 meses
Puntos: 1
Respuesta: Las animaciones Flash no me muestran los caracteres con acentos (Español)


¿Será que Flash/Xml son únicamente para el idioma inglés?

  #4 (permalink)  
Antiguo 18/01/2010, 11:45
jcl
 
Fecha de Ingreso: enero-2002
Mensajes: 673
Antigüedad: 22 años, 3 meses
Puntos: 1
Respuesta: Las animaciones Flash no me muestran los caracteres con acentos (Español)

Bueno, al parecer, todo depende del que programe el Script de AC.

Fíjate que hay un ejemplo aquí: http://www.after-hours.org/2005/01/02/flash-xml-cdata/

En donde si es posible leer correctamente las letras con acentos, pues probé con la palabra “ASFusion” la cual cambié por “ASFusión” y el resultado fue el correcto, según la lista que despliega el ejemplo:

Les coloco el código del ejemplo que sí leer y muestra los acentos, y el de mi animación, en donde NO se leen ni se muestran esos caracteres especiales:

CÓDIGO CMPLETO DEL EJEMPLO BUENO:
XML:

1. <?xml version="1.0" encoding="utf-8"?>
2. <enlaces>
3. <titulo>
4. <![CDATA[
5. <font color="#999999" face="Verdana" size="9">
6. <b>Mis enlaces favoritos</b>
7. </font>]]>
8. </titulo>
9. <categoria>
10. <![CDATA[
11. <font color="#999999" face="Verdana" size="9">
12. <b>Cat:&nbsp;</b><i>Blogs</i>
13. </font>
14.
15. ]]>
16. </categoria>
17. <lista>
18. <![CDATA[
19. <font color="#760000" face="Verdana" size="9">
20. <ul>
21. <li><a href="http://www.asfusion.com/blog/index.cfm?setlan=es">ASFusion</a></li>
22. <li><a href="http://www.carlosrovira.com/">Carlos Rovira</a></li>
23. <li><a href="http://www.code4net.com/">Code 4 Net</a></li>
24. <li><a href="http://www.cristalab.com/">Cristalab</a></li>
25. <li><a href="http://www.design-nation.net/es/">Design-nation</a></li>
26. <li><a href="http://www.elecash.org/blog/">Elecash</a></li>
27. <li><a href="http://www.10-lab.com/blog/">Flash Lab</a></li>
28. <li><a href="http://www.flashla.com/">Flashla</a></li>
29. <li><a href="http://blog.innocuo.com/">Innocuo</a></li>
30. <li><a href="http://www.kadazuro.com/blog/">Kadazuro</a></li>
31. <li><a href="http://klr20mg.com/">Krl20Mg</a></li>
32. <li><a href="http://www.nomaster.com">nomaster</a></li>
33. <li><a href="http://www.oscartrelles.com/es/">Oscar Trelles</a></li>
34. <li><a href="http://www.sidedev.net/blog/">SideDev</a></li>
35. <li><a href="http://x-flash.org/blog/index.html">X-Flash</a></li>
36. </ul>
37. </font>]]>
38. </lista>
39. </enlaces>

Actionscript:

1. Stage.scaleMode = "noscale";
2. miXML = new XML();
3. miXML.ignoreWhite = true;
4. // -- creo un campo de texto
5. createTextField("texto", this.getNextHighestDepth, 10, 10, "", "");
6. texto.html = true;
7. texto.multiline = true;
8. texto.autoSize = true;
9. // -- cargo XML
10. miXML.onLoad = function(succes) {
11. if (succes) {
12. // --
13. var parent = this.firstChild.childNodes;
14. titulo = parent[0].firstChild.nodeValue;
15. categoria = parent[1].firstChild.nodeValue;
16. lista = parent[2].firstChild.nodeValue;
17. // --
18. texto.htmlText = titulo;
19. texto.htmlText += categoria;
20. texto.htmlText += lista;
21. }
22. };
23. // --
24. miXML.load("mixml.xml");
  #5 (permalink)  
Antiguo 18/01/2010, 11:46
jcl
 
Fecha de Ingreso: enero-2002
Mensajes: 673
Antigüedad: 22 años, 3 meses
Puntos: 1
Respuesta: Las animaciones Flash no me muestran los caracteres con acentos (Español)

CÓDIGO CMPLETO DEL EJEMPLO DE MI ANIMACIÓN:
XML:

<?xml version="1.0"?>
<content
delayTime = "8"
slideshowX = "25"
slideshowY = "25"
menuVisible = "no"
menuDirection = "x"
menuX = "5"
menuY = "235"
menuSpacing = "15"
menuOutEdgeColor = "0x000000"
menuOutBgColor = "0x333333"
menuOverEdgeColor = "0x000000"
menuOverBgColor = "0x999999">

<slideshow>
<photoX>0</photoX>
<photoY>0</photoY>
<textX>20</textX>
<textY>2</textY>
<textWidth>500</textWidth>
<photo>home_images/Picture1.jpg</photo>
<description>
<![CDATA[Set Position <font color="#0b5d92" size="20">Of the Text</font><font color="#010101" size="25"><br> From the xml file.]]>
</description>
</slideshow>

<slideshow>
<photoX>0</photoX>
<photoY>0</photoY>
<textX>10</textX>
<textY>2</textY>
<textWidth>480</textWidth>
<photo>home_images/Picture2.jpg</photo>
<description>
<![CDATA[This is an <font color="#fdc900" size="20">advanced XML Rotator</font>, You can add Punch line and <font color="#ffffff">Place anywhare on the banner </font> Load <font color="#12fc00">SWF, JPG, PNG Format</font>]]>
</description>
</slideshow>


<slideshow>
<photoX>0</photoX>
<photoY>0</photoY>
<textX>2</textX>
<textY>2</textY>
<textWidth>550</textWidth>
<photo>home_images/Picture3.jpg</photo>
<description>
<![CDATA[Normal font style <font color="#FF9900" size="20">Change color, Size of the text</font>, and <font color="#010101" size="25">Load swf files</font> all will be change with XML File. <font color="#000099" text-decoration="underline"><a href="http://www.google.com"> Make Link also on text</a></font> ]]>
</description>
</slideshow>


<slideshow>
<photoX>0</photoX>
<photoY>0</photoY>
<textX>140</textX>
<textY>2</textY>
<textWidth>400</textWidth>
<photo>home_images/Picture4.jpg</photo>
<description>
<![CDATA[<font color="#000000" size="18">ADVANCED XML Rotator</font>]]>
</description>
</slideshow>

<slideshow>
<photoX>0</photoX>
<photoY>0</photoY>
<textX>300</textX>
<textY>2</textY>
<textWidth>260</textWidth>
<photo>home_images/Picture5.jpg</photo>
<description>
<![CDATA[This is an <font color="#1e4a01" size="20" weight="bold">Advanced xml Rotator</font>, also Give text width From the xml file]]>
</description>
</slideshow>

<slideshow>
<photoX>0</photoX>
<photoY>0</photoY>
<textX>10</textX>
<textY>2</textY>
<textWidth>500</textWidth>
<photo>home_images/Picture6.jpg</photo>
<description>
<![CDATA[<font color="#000000" size="20">Advanced XML Rotator</font><font color="#ea6d1c" size="16"><a href="http://www.flashcomponents.net/author/kaplisrinku.html"><br> Make Link also on text</a></font>]]>
</description>
</slideshow>


<slideshow>
<photoX>0</photoX>
<photoY>0</photoY>
<textX>360</textX>
<textY>2</textY>
<textWidth>220</textWidth>
<photo>home_images/Picture7.jpg</photo>
<description>
<![CDATA[<font color="#000000">This is an </font><font color="#ffffff" size="20" weight="bold">Advanced xml Rotator</font> <font color="#000000"> , You can set text position on _X and _Y</font>]]>
</description>
</slideshow>


</content>

Actionscript:

this.createEmptyMovieClip("slideMenu",this.getNext HighestDepth());

//--------------------------LOAD XML DATA

function loadXML(success) {
if (success) {
xmlNode = this.firstChild;
photoX = [];
photoY = [];
textX = [];
textY = [];
textW = [];
photo = [];
description = [];
total = xmlNode.childNodes.length;
//for loop attributes of each slide
for (i=0; i<total; i++) {
photoX[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
photoY[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
textX[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
textY[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
textW[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
photo[i] = xmlNode.childNodes[i].childNodes[5].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[6].firstChild.nodeValue;
}
//main slide attributes
delayTime = Number(this.firstChild.attributes.delayTime*1000);

slideshowX = Number(this.firstChild.attributes.slideshowX);
slideshowY = Number(this.firstChild.attributes.slideshowY);

holder_mc._x = 0;
holder_mc._y = 0;

menuVisible = this.firstChild.attributes.menuVisible;
//set slide visible/invisible according to the XML file
if (menuVisible == "no" || menuVisible == "NO") {
slideMenu._visible = false;
} else {
slideMenu._visible = true;
}

menuDirection = this.firstChild.attributes.menuDirection;

menuX = Number(this.firstChild.attributes.menuX);
menuY = Number(this.firstChild.attributes.menuY);
menuSpacing = Number(this.firstChild.attributes.menuSpacing);

//Slideshow controls X and Y positions
slideMenu._x = menuX;
slideMenu._y = menuY;

menuOutEdge = this.firstChild.attributes.menuOutEdgeColor;
menuOutBg = this.firstChild.attributes.menuOutBgColor;
menuOverEdge = this.firstChild.attributes.menuOverEdgeColor;
menuOverBg = this.firstChild.attributes.menuOverBgColor;

//initialize menu
initMenu();
//initialize slide
initSlide();
} else {
trace("Error loading XML");
}
delete xmlData;
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("../xmldata/TextData.xml");

//----------------------------MAIN FUNCTIONS

//clear the interval in the beginning
//(just incase user clicks on a different menu
//and goes back - start timer over)
function clearListener() {
clearInterval(timeInterval);
}

//initialize slide function
function initSlide() {
//if slide number is undefined or last, set to first
if (n == undefined || n == total) {
n = 0;
//else do nothing
} else {
break;
}
//stop timer
clearInterval(timeInterval);
//update menu
menuColor(n);
//call main slideshow function
buildSlideshow(n);
//update slide number
n++;
}

startX = 0;
startY = 0;

fadeTargetOut.onMotionFinished = function() {
// Create listener object for loading the new asset
var mcLoader:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mcLoader.addListener(mclListener);}

//initialize menu function
function initMenu() {
//for loop for each slide
for (i=0; i<total; i++) {
//add button
slideMenu.attachMovie("menuBtn","a"+i,i);
//assign button
a = slideMenu["a"+i];
//decide whether to have menu in X or Y direction
//according to the XML file
if (menuDirection == "y" || menuDirection == "Y") {
a._y = startY;
} else {
a._x = startX;
}
//add spacer
startX += menuSpacing;
startY += menuSpacing;

//assign menu button its number
a.num = i;

//on press function
a.onPress = function() {
//stop timer
clearInterval(timeInterval);
//initialize slide / set slide number to button clicked
initSlide(n=this.num);
};
//on rollover function
a.onRollOver = function() {
menuRollOver(this.num);
};
//on rollout function
a.onRollOut = function() {
menuRollOut();
};
}
}

//main slideshow function
function buildSlideshow(i) {
//make the holder alpha 0 first (for fade in effect)
holder_mc._alpha = 0;

//align object according to the XML file attributes
holder_mc.photo_mc._x = photoX[i];
holder_mc.photo_mc._y = photoY[i];
holder_mc.des1_mc.des.description_txt._x = textX[i];
holder_mc.des1_mc.des.description_txt._y = textY[i];
holder_mc.des1_mc.des.description_txt._width = textW[i];

//load movie and text from XML file
holder_mc.photo_mc.loadMovie(photo[i]);
holder_mc.des1_mc.des.description_txt.autoSize = "left";
holder_mc.des1_mc.des.description_txt.htmlText = description[i];

//loading function
this.onEnterFrame = function() {
preloader_mc._visible = false;
preloade.preloader_txt.text = "";
bLoaded = holder_mc.photo_mc.getBytesLoaded();
bTotal = holder_mc.photo_mc.getBytesTotal();
//if photo has not loaded yet
if (bLoaded<bTotal) {
holder_mc._alpha = 100;
preloade.preloader_txt.text = Math.round((bLoaded/bTotal)*100);
holder_mc.des1_mc.gotoAndPlay(1);
//else if photo has loaded
} else if (bLoaded>=bTotal && bLoaded>100 && bTotal>100) {
//fade until alpha is 100
if (holder_mc._alpha<100) {
preloade.preloader_txt.text = "";
holder_mc._alpha = holder_mc._alpha+10;
holder_mc.des1_mc.gotoAndPlay(1);

}
//if alpha is 100, start counter
if (holder_mc._alpha>=100) {
timeInterval = setInterval(initSlide, delayTime);
//delete onEnterFrame function when done
delete this.onEnterFrame;
}
}
};
}

//Menu colors according to XML attributes
function menuColor(n) {
//for loop for each menu button
for (i=0; i<total; i++) {
//original edge colors
origEdge = new Color(slideMenu["a"+i].edge);
origEdge.setRGB(menuOutEdge);
//original main colors
origBg = new Color(slideMenu["a"+i].bg);
origBg.setRGB(menuOutBg);

//rollover edge colors
currEdge = new Color(slideMenu["a"+n].edge);
currEdge.setRGB(menuOverEdge);
//rollover main colors
currBg = new Color(slideMenu["a"+n].bg);
currBg.setRGB(menuOverBg);
}
}

Etiquetas: acentos, caracteres, español, flash, animacion
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:13.