Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Estou com um problema com o ç no meu menu em flash.
Já vi muitos tutoriais na internet, tentei de tudo (System.useCodepage=true, salvar no bloco de notas, ISO, UTF-8, ANSI...) e até agora nada.
Eis os meus códigos:
FLASH:
import mx.transitions.Tween;
import mx.transitions.easing.*;
//create function to add buttons on stage
function addButtons() {
pushOverX = 0;
for (i=0; i<obj.buttons.length; i++) {
btn = menu.attachMovie("button", "btn"+i, -i, {_x:pushOverX, id:i});
btn.t.autoSize = "left";
btn.t.text = obj.buttons[i].attributes.nome;
btn.t.textColor = tC;
btn.back._width = btn.t._width;
pushOverX += Math.round(btn._width+bS);
setBtnEvents(btn);
}
selectFirstBtn();
var cl:Color = new Color(menu.bar);
cl.setRGB(tROC);
}
//create function for buttons events
function setBtnEvents(btn:MovieClip) {
btn.onRollOver = function() {
btn = this;
st = obj.buttons[btn.id].attributes.nome;
//apply effect to this btn
btn.t.textColor = tROC;
//stop current tween
menu.bar.tweenX.stop();
menu.bar.tweenWidth.stop();
//tween bar
menu.bar.tweenX = new Tween(menu.bar, "_x", Strong.easeOut, menu.bar._x, btn._x, .6, true);
menu.bar.tweenWidth = new Tween(menu.bar, "_width", Strong.easeOut, menu.bar._width, btn.back._width, .6, true);
//apply effect to pressed btn
pressedBtn.t.textColor = tC;
typeText(pressedBtn.t,obj.buttons[pressedBtn.id].attributes.nome,0,1);
};
btn.onRollOut = function() {
btn = this;
st = obj.buttons[btn.id].attributes.nome;
//apply effect to this btn
btn.t.textColor = tC;
//stop current tween
menu.bar.tweenX.stop();
menu.bar.tweenWidth.stop();
//tween bar
menu.bar.tweenX = new Tween(menu.bar, "_x", Strong.easeOut, menu.bar._x, pressedBtn._x, .6, true);
menu.bar.tweenWidth = new Tween(menu.bar, "_width", Strong.easeOut, menu.bar._width, pressedBtn.back._width, .6, true);
//apply effect to pressed btn
pressedBtn.t.textColor = tROC;
typeText(pressedBtn.t,obj.buttons[pressedBtn.id].attributes.nome,0,5);
};
btn.onPress = function() {
pressedBtn.enabled = true;
pressedBtn = this;
this.enabled = false;
get_url();
}
}
function selectFirstBtn(){
pressedBtn = menu.btn0;
pressedBtn.enabled = true;
//tween bar
menu.bar.tweenX = new Tween(menu.bar, "_x", Strong.easeOut, menu.bar._x, pressedBtn._x, .6, true);
menu.bar.tweenWidth = new Tween(menu.bar, "_width", Strong.easeOut, menu.bar._width, pressedBtn.back._width, .6, true);
//apply effect to this btn
pressedBtn.t.textColor = tROC;
typeText(pressedBtn.t,obj.buttons[pressedBtn.id].attributes.nome,0,5);
}
function get_url() {
getURL (obj.buttons[pressedBtn.id].attributes.link, "_self");
}
//this function is for preview
function demoFunction(st:String){
demoMC._alpha = 100;
demoMC.t.text = st;
demoMC.t.textColor = tROC;
demoMC.tweenAlpha = new Tween(demoMC, "_alpha", Strong.easeIn, 100, 0, 1, true);
}
//create sound object to load the rollover sound (you can change the path for another sound)
var tC:Number = new Number();//text color
var tROC:Number = new Number();//rollover text color
var bS:Number = new Number();//buttons spacing
var pressedBtn:MovieClip = new MovieClip();
//object that contains data from xml
var obj:Object = new Object();
//create nex xml object
var xml:XML = new XML();
xml.ignoreWhite = true;
//after the xml is loaded, load variables and parse the date to obj
xml.onLoad = function(succes) {
if (succes) {
tC = Number(this.firstChild.attributes.textColor);
tROC = Number(this.firstChild.attributes.rolloverColor);
bS = Number(this.firstChild.attributes.spacing);
obj.buttons = this.firstChild.childNodes;
//function call
addButtons();
} else {
trace("xml could not load");
}
};
//the path to the xml file
xml.load("menu.xml");
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<menu textColor="0x666666" rolloverColor="0xb58f6a" spacing="4">
<item nome=" Home " link="http://"/>
<item nome=" A Empresa " link="http://"/>
<item nome=" Nossos Serviços " link="http://"/>
<item nome=" Contatos " link="http://"/>
</menu>
Alguém pode me ajudar??
Desde já agradeço!
Carregando comentários...