The forums are currently locked and only available for read only access
LightX01
Kommer du hit ofta?
Medlem
Forum Posts: 472
Member Since:
October 10, 2002
October 10, 2002
Offline
Hej har ett problem, jag läser in en XML fil i flash med information till en textruta, allt fungerade som det skulle och renderade allt enligt HTML taggarna. Men helt plötsligt så slutar den rendera taggar.
taggen fungerar. Vad har jag gjort för fel?Texten som står inom tagen försvinner medans resten av texten syns. ÅÄÖ slutar också att fungera. Har XML filen sparad i UTF-8.
Hjälp
LightX01
Kommer du hit ofta?
Medlem
Forum Posts: 472
Member Since:
October 10, 2002
October 10, 2002
Offline
//XML --------- XML --------- START --------- XML --------- XML
var m_isXmlLoaded = false;
var m_DEBUG = false;
//Load m_xml
var m_xml = new XML();
m_xml.ignoreWhite = true;
m_xml.onLoad = function(success) {
m_isXmlLoaded = success;
if (m_isXmlLoaded && m_DEBUG) {
var objXml = new GetXmlData('sverige');
trace(objXml.ID);
trace(objXml.Name);
trace(objXml.Text);
}
};
m_xml.load("text.xml");
function GetXmlData(id) {
this.ID = null;
this.Name = null;
this.Text = null;
this.Link = null;
var node = m_xml.firstChild.childNodes;
for (var i = 0; i<node.length; i++) {
if (node[i].attributes.id == id) {
//node found
this.ID = node[i].attributes.id;
//get subnode values
for (var u = 0; u<node[i].childNodes.length; u++) {
/*
trace('nodename: '+ node[i].childNodes[u].nodeName.toLowerCase());
trace('nodevalue: '+ node[i].childNodes[u].firstChild.nodeValue);
*/
switch (node[i].childNodes[u].nodeName.toLowerCase()) {
case 'text' :
this.Text = node[i].childNodes[u].firstChild.nodeValue;
break;
case 'name' :
this.Name = node[i].childNodes[u].firstChild.nodeValue;
break;
case 'link' :
this.Link = node[i].childNodes[u].firstChild.nodeValue;
break;
}
}
break;
} else {
this.ID = null;
this.Name = null;
this.Text = null;
this.Link = null;
}
}
}
//XML --------- XML --------- SLUT --------- XML --------- XML
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1030
Currently Online:
Guest(s) 508
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Andreas Galistel: 16287
Jonas Klar: 15897
ilg@dd: 10810
Nyhet: 10607
Mind: 10550
Ctrl: 10355
Gueno: 9881
Guest: 9344
Snorch: 8881
Callister: 8468
Newest Members:
PetrbonFU PetrbonFU
Karine Bembry
Dolores Mcdaniels
Anibal McLeish
Francisca Alt
Alfie Everhart
Lester Huitt
Orlando Jorgensen
Mikki Lundgren
Dakota Kozlowski
Forum Stats:
Groups: 11
Forums: 59
Topics: 146630
Posts: 1300967
Member Stats:
Guest Posters: 2
Members: 79425
Moderators: 0
Admins: 11
Administrators: nordicadmin, Henrik Berntsson, Anton Karmehed, Carl Holmberg, Joel Oscarsson, Mikael Linnér, Mikael Schwartz, Andreas Paulsson, Nickebjrk, Mattias Pettersson, EmxL
© Simple:Press —