all groups > flash actionscript > march 2007 >
You're in the

flash actionscript

group:

Actionscript e XML


Actionscript e XML rafuSExtreem
3/4/2007 7:06:54 PM
flash actionscript:
Hi all!

Ihave an actionscript code in flash that imports a xml file.
The problem is I cant`t make flash show signs like "^" , "?" or "~" etc.
I already have tried the 2 options that we can find on internet

System.useCodepage="true"; with one xml file without unicode or UTF-8

or a System.useCodepage="false"; with a xml file saved as notepad with unicode
and UTF-8

But the swf file simply don`t want to show the signs..

thats the actionscript code:



//hide the flash right click menu items:


Stage.showMenu = false;
Stage.scaleMode = "noScale";
Stage.align = "T";

//hide the flash menu until the XML loads

_parent._visible = false;

// xml processing

menu_cfg_xml = new XML();
menu_cfg_xml.load("menu.xml");
menu_cfg_xml.ignoreWhite = 1;

//

menu_cfg_xml.onLoad = function(ok) {

// create main menu after successful loading of XML

if (ok) {
create_menu();
} else {
trace("XML not loaded");
}
};


//
counter = 1;
function create_menu() {
while (counter<menu_cfg_xml.firstChild.childNodes.length ) {
attachMovie("button_type", "btn"+counter, counter);
set("btn"+counter+"._y", counter*26-26);
btn1._y = 0;

// set the buttons text

set("btn"+counter+".the_text",
menu_cfg_xml.firstChild.childNodes[counter].attributes.texto);
set("btn"+counter+".the_url",
menu_cfg_xml.firstChild.childNodes[counter].attributes.url);
set("btn"+counter+".the_target",
menu_cfg_xml.firstChild.childNodes[counter].attributes.target);
this["btn"+counter].onRollOver = this["btn"+counter].onDragOver=function () {
this.effect.gotoAndPlay(2);
this.textul1.textColor =
"0x"+menu_cfg_xml.firstChild.childNodes[0].attributes.text_color2;
};
this["btn"+counter].onRollOut = this["btn"+counter].onDragOut=function () {
this.textul1.textColor =
"0x"+menu_cfg_xml.firstChild.childNodes[0].attributes.text_color1;
this.effect.gotoAndPlay(9);
};
this["btn"+counter].onRelease = function() {
if (this.the_url != undefined and this.the_url != "") {
getURL(this.the_url, this.the_target);
}
};


//set buttons color


this["button_color"+counter] = new Color("btn"+counter+".btn_color");

this["button_color"+counter].setRGB("0x"+menu_cfg_xml.firstChild.childNodes[0].a
ttributes.button_color);

//set button effect color

this["effect_color"+counter] = new Color("btn"+counter+".effect");

this["effect_color"+counter].setRGB("0x"+menu_cfg_xml.firstChild.childNodes[0].a
ttributes.effect_color);

//set button text color

this["btn"+counter].textul1.textColor =
"0x"+menu_cfg_xml.firstChild.childNodes[0].attributes.text_color1;
counter++;
}
_parent._visible = true;
info_clip._visible = false;
}
Re: Actionscript e XML tonyhigham
3/4/2007 9:02:50 PM
The only way I was able to replicate this problem was to use a text field with
embedded fonts that didn't have the proper characters embedded. So...you might
need to check which characters you have embedded. You can either choose the
necessary category, or type in the non-alphanumeric characters that you need
manually in the provided field.
AddThis Social Bookmark Button