Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

marcelomn11

Acentuação no Flash com XML

Recommended Posts

Caros amigos!

 

sou novo no fórum, e nem sei se estou postando no lugar certo, mas vamos lá!

 

estou com uma porcaria de uma dúvida aki,não consigo de forma alguma acentuar as coisas no flash, usei o UTF-8, iso8998, limpei pelo bloco de notas, coloquei system.code= false = true.

 

NADA

NADA

e NADA

 

MEU XML está assim:

<?xml version="1.0" encoding="UTF-8"?>
<menu>




<object param="maxThumbWidth" value="250" />
<object param="maxThumbHeight" value="167" />

<object param="itemsOffset" value="190" />

       <object param="itemsX" value="0" /> <!-- thumbs menu together with the scroll bar and buttons clip position -->
       <object param="itemsY" value="0" />

       <object param="thumbsX" value="0" /> <!-- only thumbs menu clip position -->
       <object param="thumbsY" value="0" />

       <object param="useButtonsRollOverScroll" value="0" />
       <object param="useButtonsPressScroll" value="1" />

<object param="tweenDecay" value=".1" />  <!-- tween speed values -->
<object param="tweenToleration" value=".2" />


<object param="percentageStepMax" value="1" /> <!-- percentage scroll step (value from 0 to 100) -->


<object param="useMirror" value="1" />
<object param="mirrorHeightGaign" value="0.3" /> <!-- percentage value between 0 and 1 to increase or decrease the mirror height -->
<object param="mirrorOffset" value="0" /> <!-- the offset distance between image and mirror -->

<object param="useRollOverColoring" value="1" />
<object param="rollOverColorIntensity" value="25" />
<object param="rollOutColorIntensity" value="-25" />
<object param="coloringSpeed" value="5" />

<object param="showThumbTitle" value="1" />
<object param="titleXOffset" value="10" />
<object param="titleYOffset" value="180" />

       <object param="thumbsScrollAlpha" value="100" /> <!-- a numeric value between 0 and 100 -->
       <object param="thumbsScrollViewAreaWidth" value="940" /> <!-- visible area width -->
<object param="thumbsScrollViewAreaHeight" value="400" /> <!-- visible area height -->
<object param="thumbsScrollAcceleration" value="0.1" />
<object param="thumbsScrollMode" value="scrollBar" /> <!-- can be full, scrollBar, buttons -->

<object param="colorElem" value="0x0066FF" />


       <!-- images group parameters -->

  	<object source="images/afaBistro.jpg" url="http://www.afabistro.com.br" window="_blank" title="Afa Bistr�" description="" />
<object source="images/bigLanche.jpg" url="http://www.biglanche.com.br" window="_blank" title="Big Lanche" description="" />
<object source="images/boutiqueGelada.jpg" url="http://www.boutiquegelada.com.br" window="_blank" title="Boutique Gelada" description="" />
<object source="images/chaleDoTrigo.jpg" url="http://www.chaledotrigo" window="_blank" title="Chal� do Trigo" description="site em constru��o " />
<object source="images/comvelVeiculos.jpg" url="http://www.comvelveiculos.com.br" window="_blank" title="Comvel Veiculos" description="" />
       <object source="images/confederacaoDeBeachTennis.jpg" url="http://www.confederacaodebeachtennis" window="_blank" title="Beach Tennis" description="" />
<object source="images/corb.jpg" url="http://www.corb.com.br" window="_blank" title="Corb" description="" />
<object source="images/emagrecentroCentro.jpg" url="http://www.emagrecentrocentro.com.br" window="_blank" title="Emagrecentro Centro" description="" />
<object source="images/emagrecentroHigienopolis.jpg" url="http://www.emagrecentroHigienopolis.com.br" window="_blank" title="Emagrecentro Higien�polis" description="" />
<object source="images/emagrecentroPinheiros.jpg" url="http://www.emagrecentroPinheiros.com.br" window="_blank" title="Emagrecentro Pinheiros" description="" />
<object source="images/fact.jpg" url="http://www.fact.esp.br" window="_blank" title="Fact" description="" />
<object source="images/federacaoDeBeachTennisDoRJ.jpg" url="http://www.federacaoDeBeachTennisDoRJ.com.br" window="_blank" title="Federacao de Beach Tennis do RJ" description="" />
<object source="images/grupoIrmaosPinheiro.jpg" url="http://www.irmaospinheiro.com.br" window="_blank" title="Grupo Irm�os Pinheiro" description="" />
<object source="images/irisTavares.jpg" url="http://www.iristavares.com" window="_blank" title="�ris Tavares" description="" />
<object source="images/irmaosCapuci.jpg" url="http://www.irmaoscapuci.com.br" window="_blank" title="Irm�os Capuci" description="" />
<object source="images/jbGrill.jpg" url="http://www.jbgrill.com.br" window="_blank" title="JB Grill" description="" />
<object source="images/masucoNaganuma.jpg" url="http://www.masuconaganuma.com.br" window="_blank" title="Masuco Naganuma" description="" />
<object source="images/naganuma.jpg" url="http://www.naganuma.com.br" window="_blank" title="Naganuma" description="" />
<object source="images/nilcestur.jpg" url="http://www.nilcestur.com.br" window="_blank" title="Nilcestur" description="" />
<object source="images/oRioBranco.jpg" url="http://www.oriobranco.net" window="_blank" title="O Rio Branco" description="" />
<object source="images/paoDeQueijo.jpg" url="http://www.buffetpaodequeijo.com.br" window="_blank" title="Buffet P�o de Queijo" description="" />
<object source="images/peelingDeDiamante.jpg" url="http://www.peelingdediamante.com.br" window="_blank" title="Peeling de Diamante" description="" />
<object source="images/purimContabilidade.jpg" url="http://www.purimcontabilidade.com.br" window="_blank" title="Purim Contabilidade" description="" />
<object source="images/purimoveis.jpg" url="http://www.purimoveis.com.br" window="_blank" title="Purimoveis" description="" />
<object source="images/rafaelBonamim.jpg" url="http://www.rafaelbonamimfotografia.com.br" window="_blank" title="Rafael Bonamim Fotografia" description="" />
<object source="images/rafisaGanum.jpg" url="http://www.rafisaganum.com.br" window="_blank" title="Rafisa Ganum" description="" />
<object source="images/rosasfarma.jpg" url="http://www.rosasfarma.com.br" window="_blank" title="Rosas Farma" description="" />
<object source="images/rubedna.jpg" url="http://www.rubedna.com.br" window="_blank" title="Rubedna Braga" description="" />
<object source="images/saoBento.jpg" url="http://www.saobentoincorporadora.com.br" window="_blank" title="S�o Bento Incorporadora" description="" />
<object source="images/shirakawa.jpg" url="http://www.shirakawa.com.br" window="_blank" title="Restaurante Shirakawa" description="" />
<object source="images/sobep.jpg" url="http://www.sobep.org.br" window="_blank" title="SOBEP" description="" /><object source="images/shirakawa.jpg" url="http://www.shirakawa.com.br" window="_blank" title="Restaurante Shirakawa" description="" />
<object source="images/tatia.jpg" url="http://www.tatiauniformes.com.br" window="_blank" title="Tati� Uniformes" description="em construcao" />
<object source="images/tie.jpg" url="http://www.tiefv.com.br" window="_blank" title="Tiefv" description="" />
<object source="images/vlg.jpg" url="http://www.vlg.com.br" window="_blank" title="VLG" description="" />
<object source="images/wps.jpg" url="http://www.wps.com.br" window="_blank" title="WPS" description="" />
<object source="images/zarghus.jpg" url="http://www.zarghus.com.br" window="_blank" title="Zarghus" description="" />

</menu>

 

e meu Action ta assim:

 


				// BUTTONS PARAMETERS //

var percentageStepMax = 3; //percentage scroll step (value from 0 to 100)

var tweendecay = .1; //tween parameters
var tweentoleration = .2; 

var useRollOverScroll = 1; // can be 0/1 - disable/enable buttons roll over scroll
var usePressScroll = 0;   // can be 0/1 - disable/enable buttons press scroll


				     // END PARAMETERS //


sb1.colorOverlay = "true";
trace("1:"+sb1.colorOverlay);
sb1.sliderBodyColorIdle = 0x0099FF;


var signum = 0;
var percentageStep = 0; 

this.onEnterFrame = moveScroller;

function moveScroller() {
percentageStep = tween(percentageStep, signum*percentageStepMax);
//trace(signum+"  "+percentageStep);
//sb1.scrollPercentage += (percentageStep * signum);
sb1.scrollPercentage += percentageStep;
}

// LEFT BUTTON events //
bleft._alpha = 0;   


bleft.onPress = function() { 
   if (usePressScroll) signum = -1;
this.gotoAndStop(3);
};

bleft.onRelease = function() { 
if (usePressScroll) signum = 0;
this.gotoAndStop(1);
};

bleft.onReleaseOutside = function() { 
if (usePressScroll) signum = 0;
this.gotoAndStop(1);
};

bleft.onRollOver = function() {
if (useRollOverScroll) signum = -1;
this.gotoAndStop(2);

var colArrow:Color = new Color(bleft.leftArrow);
colArrow.setRGB(mc1.colorElem);

this.leftArrow._alpha = 80;
this._alpha=100;
}

bleft.onRollOut = function() {
if (useRollOverScroll) signum = 0;
this.gotoAndStop(1);
 this._alpha=0;
}


// RIGHT BUTTON events //
bright._alpha=0;

bright.onPress = function() {	
if (usePressScroll) signum = 1;
this.gotoAndStop(3);

};

bright.onRelease = function() {
if (usePressScroll) signum = 0;
this.gotoAndStop(1);
};

bright.onReleaseOutside = function() {
if (usePressScroll) signum = 0;
this.gotoAndStop(1);
};


bright.onRollOver = function() { 
if (useRollOverScroll) signum = 1;
this.gotoAndStop(2);

var colArrow:Color = new Color(bright.rightArrow);
colArrow.setRGB(mc1.colorElem);

this.rightArrow._alpha = 80;
this._alpha=100;
}

bright.onRollOut = function() { 
if (useRollOverScroll) signum = 0;
this.gotoAndStop(1);
this._alpha=0;
}




// OPTIONAL CODE -> DEFAULT SCROLL BAR BUTTONS WITH ROLL OVER // 

listenerObject = new Object();
listenerObject.upButtonRollOver = function(eventObject){
if (useRollOverScroll) signum = -1;
}
listenerObject.upButtonRollOut = function(eventObject){
signum = 0;
}
listenerObject.downButtonRollOver = function(eventObject){
if (useRollOverScroll) signum = 1;
}
listenerObject.downButtonRollOut = function(eventObject){
signum = 0;
}

sb1.addEventListener("upButtonRollOver",listenerObject);
sb1.addEventListener("upButtonRollOut",listenerObject);
sb1.addEventListener("downButtonRollOver",listenerObject);
sb1.addEventListener("downButtonRollOut",listenerObject);



// TWEEN METHOD USED IN CALCULATION
function tween(pos1, pos2) {
if (Math.abs(pos2-pos1)<= tweentoleration) {
	return pos2;
} else {
	return (pos1 + tweendecay*(pos2-pos1));
}
}   


e a outra parte do FLASH está assim




import flash.geom.ColorTransform; //for rollOver/rollOut color intensity effect
import flash.geom.Transform;

Stage.align = "TL";
Stage.scaleMode = "noScale";

							// MAIN PARAMETERS //

var xmlData = "config.xml"; //set xml data file
var useBitmapSmoothing = 1; // 0/1 -> use or not bitmap smoothing

var offset = 10; //offset distance between photos

var maxThumbWidth = 60; // the thumb width / height in pixels
var maxThumbHeight = 60;

var colorElem = 0x0099FF;


//MIRROR PARAMS
var useMirror = 1;            // can be 0 or 1 
var mirrorHeightGaign = 0.3; //percentage value between 0 and 1 to increase/decrease the mirror height
                        	// 0 - no mirror 	
var mirrorOffset = 0;  //the offset distance between image and mirror


//onRollOver / onRollOut color intensity 
//you need to disable zoom when using coloring and vice-versa

var useRollOverColoring = 1; // 1 - use coloring, 0 - don't use coloring 
var rollOverColor = 25;       //images onRollOver color intensity
var rollOutColor = -25;   //images onRollOut color intensity
var coloringSpeed = 5;     //RollOver / RollOut color speed

var maxC = rollOverColor + Math.abs(rollOutColor);

//show titles
var showTitle = 1;	//can be 0 or 1
var titleYOffset = 60;
var titleXOffset = 2;

dummy._visible = false;

//////////////////////////////// END MAIN PARAMS /////////////////////////////



			     // AUXILIARY VARIABLES USED IN CALCULATION //		

var xmlObj: XML;
var nodes = new Array();

						// METHODS //

//if xml file is defined with FlashVars, overwrite the default xml file name 
if (_root.xmlFile!=undefined) xmlData = unescape(_root.xmlFile);

init(); //init call -> load config XML and create objects

function init() {
xmlObj = new XML(xmlData); 
xmlObj.ignoreWhite = true;
xmlObj.load(xmlData);
this.onEnterFrame = checkXMLprogress;
}

function checkXMLprogress() {	
   var tmpBytesLoaded = xmlObj.getBytesLoaded();
   var tmpBytesTotal = xmlObj.getBytesTotal();
   if ((tmpBytesLoaded==tmpBytesTotal) && (tmpBytesTotal > 4)) {
	delete this.onEnterFrame;
	addObjects();
  	} //end if   
}



function addObjects() { //add objects in the scene

var objects = xmlObj.firstChild.childNodes;
var j = 0;

for(var i=0; i<objects.length; i++) {
//trace(objects[i].attributes.param+"  "+objects[i].attributes.value);
if (objects[i].attributes.param != undefined) {

    if (objects[i].attributes.param=="itemsOffset") this.offset = Number(objects[i].attributes.value); 	     

    if (objects[i].attributes.param=="maxThumbWidth") this.maxThumbWidth = Number(objects[i].attributes.value); 	
       if (objects[i].attributes.param=="maxThumbHeight") this.maxThumbHeight = Number(objects[i].attributes.value); 	

    if (objects[i].attributes.param=="itemsX") this._parent._x = Number(objects[i].attributes.value); 	     
    if (objects[i].attributes.param=="itemsY") this._parent._y = Number(objects[i].attributes.value); 	     

    if (objects[i].attributes.param=="thumbsX") this._x = Number(objects[i].attributes.value); 	     
	if (objects[i].attributes.param=="thumbsY") this._y = Number(objects[i].attributes.value); 	

    if (objects[i].attributes.param=="useButtonsRollOverScroll") this._parent.useRollOverScroll = Number(objects[i].attributes.value); 	
     if (objects[i].attributes.param=="useButtonsPressScroll") this._parent.usePressScroll = Number(objects[i].attributes.value); 	

    if (objects[i].attributes.param=="tweenDecay") this._parent.tweendecay = Number(objects[i].attributes.value); 	
     if (objects[i].attributes.param=="tweenToleration") this._parent.tweentoleration = Number(objects[i].attributes.value); 	

      if (objects[i].attributes.param=="percentageStepMax") this._parent.percentageStepMax = Number(objects[i].attributes.value); 	

    if (objects[i].attributes.param=="thumbsScrollAlpha") this._parent.sb1._alpha = Number(objects[i].attributes.value); 	
    if (objects[i].attributes.param=="thumbsScrollViewAreaWidth") this._parent.sb1.viewAreaWidth = Number(objects[i].attributes.value); 	
      if (objects[i].attributes.param=="thumbsScrollViewAreaHeight") this._parent.sb1.viewAreaHeight = Number(objects[i].attributes.value); 	
    if (objects[i].attributes.param=="thumbsScrollAcceleration") this._parent.sb1.scrollAcceleration = Number(objects[i].attributes.value); 	     
     if (objects[i].attributes.param=="thumbsScrollMode") this._parent.sb1.scrollMode = objects[i].attributes.value; 	     

    if (objects[i].attributes.param=="useMirror") this.useMirror = Number(objects[i].attributes.value); 	
    if (objects[i].attributes.param=="mirrorHeightGaign") this.mirrorHeightGaign = Number(objects[i].attributes.value); 	
     if (objects[i].attributes.param=="mirrorOffset") this.mirrorOffset = Number(objects[i].attributes.value); 	

     if (objects[i].attributes.param=="useRollOverColoring") this.useRollOverColoring = Number(objects[i].attributes.value); 	
     if (objects[i].attributes.param=="rollOverColorIntensity") this.rollOverColorIntensity = Number(objects[i].attributes.value); 	
      if (objects[i].attributes.param=="rollOutColorIntensity") this.rollOutColorIntensity = Number(objects[i].attributes.value); 	
      if (objects[i].attributes.param=="coloringSpeed") this.coloringSpeed = Number(objects[i].attributes.value); 	

      if (objects[i].attributes.param=="showThumbTitle") this.showTitle = Number(objects[i].attributes.value); 	
       if (objects[i].attributes.param=="titleXOffset") this.titleXOffset = Number(objects[i].attributes.value); 	
       if (objects[i].attributes.param=="titleYOffset") this.titleYOffset = Number(objects[i].attributes.value); 	

 	if (objects[i].attributes.param=="colorElem") this.colorElem = Number(objects[i].attributes.value); 	

}
else {

 //var link = objects[i].attributes.smallimage; //the image link in the xml file
var source1 = "imgMc"; //image mc linkage id from the library 
var sourceType1 = "library";
var regName1 = "p"+j; //the registration name used in Flash

 // LOAD SMALL IMAGE //
this.attachMovie(source1,regName1,1000+j);

// SET SMALL IMAGES POSITION // 
var x1 = (j * (this[regName1]._width + offset));
var y1 = 0;

this[regName1]._x = x1;
this[regName1]._y = y1;

this[regName1]["info"] = objects[i]; //keep the XML node info
nodes[j] = this[regName1];       	//add object to nodes array
//trace(this._parent.sb1);
//var my_color:Color = new Color( this._parent.sb1.sliderBody_Idle);
// my_color.setRGB(colorElem);

j++;

} //end else
}
}
function setColors(){
this._parent.sb1.colorOverlay = "true";
trace(this._parent.sb1);
this._parent.sb1.sliderBodyColorIdle = 0x0099FF;
}

//setColors();


function activateHandlers(obj) {
obj.onPress = pressHandler;
obj.onRelease = obj.onReleaseOutside = releaseHandler;
obj.onRollOver = rollOverHandler;
obj.onRollOut = rollOutHandler;  		
}


function pressHandler() {

//ADD CUSTOM CODE HERE WHEN THE IMAGE IS PRESSED

bpress();
}

function releaseHandler() {

//ADD CUSTOM CODE HERE WHEN THE IMAGE IS RELEASED

brelease();

//open url
openURL(this);

if (useRollOverColoring) {	
 resetColor(this);	
}
}


// rollOver/rollOut handlers

function setColor(obj) {
var trans:Transform = new Transform(obj);
var colorTrans:ColorTransform = new ColorTransform();
//colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset=0; 
colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=0; 
obj.onEnterFrame = function () {
if (colorTrans.blueOffset < maxC) {		
    // colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset+=coloringSpeed;
    colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset+=coloringSpeed;
 	trans.colorTransform = colorTrans;
   }
else {delete obj.onEnterFrame;}
 }	
}

function resetColor(obj) {
   var trans:Transform = new Transform(obj);
var colorTrans:ColorTransform = new ColorTransform();
//colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset= maxC;
colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset= maxC;
obj.onEnterFrame = function () {
    if (colorTrans.blueOffset > 0) {
 	     //colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset=colorTrans.alphaOffset -= coloringSpeed;
     colorTrans.blueOffset = colorTrans.greenOffset = colorTrans.redOffset -= coloringSpeed;
        trans.colorTransform = colorTrans;
	}	
  else {delete obj.onEnterFrame;}
 }	
}



function rollOverHandler() {

if (showTitle) this["title"].gotoAndPlay(2);	

this.imgMc_bkg._alpha = 100;

this["title"]["titleBox"].tf.textColor = 0xFFFFFF;
this["description"]["descBox"].tfd.textColor = 0xFFFFFF;
this["textLink"]["linkBox"].tfl.backgroundColor = 0xFFFFFF;
this["textLink"]["linkBox"].tfl.textColor = colorElem;


if (useRollOverColoring) {	
 setColor(this);
}

}

function rollOutHandler() {

if (showTitle) this["title"].gotoAndStop(1);

this.imgMc_bkg._alpha = 0;
this["title"]["titleBox"].tf.textColor = colorElem;
this["description"]["descBox"].tfd.textColor = 0x333333;
this["textLink"]["linkBox"].tfl.backgroundColor = colorElem;
this["textLink"]["linkBox"].tfl.textColor = 0xFFFFFF;

if (useRollOverColoring) {	
 resetColor(this);	
}

if (useZoom) {
 this.swapDepths(this["dpth"]); 
 resetZoom(this);	
}  
}

// end rollOver / rollOut colors //


function openURL(obj) {
//navigate to an url if url!=undefined
var setLink = ((obj["info"].attributes.url!=undefined) && (obj["info"].attributes.url!=""));
if (setLink) {
 	getURL(obj["info"].attributes.url,obj["info"].attributes.window);
}
}


//setMirror() -> added May, 21 2008
//targetMc -> target Movie Clip to apply mirror
//mirrorMc -> mirror Movie Clip
//maskMcLinkageId -> mirror gradient mask linkage id mask from the library

function setMirror(targetMc,mirrorMc,maskMcLinkageId) {

mirrorMc._y = targetMc._y + 2*targetMc._height + mirrorOffset;

mirrorMc._yscale = -100;

mirrorMc.cacheAsBitmap = true;

targetMc._parent.attachMovie(maskMcLinkageId,maskMcLinkageId,100);

targetMc._parent[maskMcLinkageId].cacheAsBitmap = true;

targetMc._parent[maskMcLinkageId]._width = mirrorMc._width; //set proper reflexion size
targetMc._parent[maskMcLinkageId]._height = mirrorMc._height*mirrorHeightGaign;

targetMc._parent[maskMcLinkageId]._y = targetMc._y + targetMc._height + mirrorOffset;
targetMc._parent[maskMcLinkageId]._x = targetMc._x;

mirrorMc.setMask(targetMc._parent[maskMcLinkageId]);	

}

Compartilhar este post


Link para o post
Compartilhar em outros sites

Então cara, ai que está a zica!

 

o MC que está puxando esse arquivo do xml é apenas uma caixa de texto que está escrito thumbnailMC em vermelho com fonte verdana, não tem nenhum tipo de formatação ali! NADA!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tente o seguinte:

Copie todo o conteúdo do seu XML (Ctrl+C);

Abra o bloco de notas (NotePad) e cole este conteúdo (Ctrl+V);

Salve este novo arquivo como XML, para isso, altere a opção "Tipo" para "Todos os arquivos". Mas atenção: Em "Codificação", selecione a opção "UTF-8".

 

Utilize este novo arquivo no lugar do XML anterior e veja se resolve o problema.

 

Att.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Selecione a caixa de texto, no painel properties clique em >> Embedding, selecione as opções Uppercase, Lowercase, Punctuation, Numerals e Latin I.

 

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.