18/01/2010, 11:46
|
| | Fecha de Ingreso: enero-2002
Mensajes: 673
Antigüedad: 22 años, 10 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);
}
} |