Hey all,
I’m having some problems when calling in data from a MySql database.
I use PHP to generate an XML file, wich then gets called into flash.
any help would be highly appreciated.
What happens is that an extra line-break (or newlin or br or whatever) is added in Flash.
I have put my example here :
http://www.indewulf.be/test/keuken.swf
My xml file is here (doesn’t work in IE, works in mozilla) :
http://www.indewulf.be/php/keuken.php
All my text fields have HTML enabled in flash,
this is my main chunk of code :
var add_next_here = 30;
function GenerateMenu(menu_xml){
var menus = menu_xml.firstChild.childNodes;
var prijs = menus[0].firstChild;
prijs_txt.html = true;
prijs_txt.autoSize = true;
prijs_txt.htmlText = prijs;
for (var i = 1; i < menus.length; i++){
this_menu = menus*.childNodes;
for (var i = 1; i < this_menu.length; i++){
gerecht = this_menu*;
gerecht_oms = gerecht.childNodes[0].firstChild.nodeValue;
gerecht_wijn = gerecht.childNodes[1].firstChild.nodeValue;
if(gerecht_wijn == undefined){gerecht_wijn = '()';}
this_gerecht_mc = main_mc.attachMovie("gerecht_mc","gerecht" add i,i);
// set up shortcuts
gerecht_txt = this_gerecht_mc.gerecht_txt;
wijn_txt = this_gerecht_mc.wijn_txt;
//
gerecht_txt.autoSize = true;
// set text
gerecht_txt.html = true;
gerecht_txt.htmlText = gerecht_oms;
wijn_txt.text = gerecht_wijn;
wijn_txt._y = gerecht_txt._height;
this_gerecht_mc._y = add_next_here;
add_next_here += this_gerecht_mc._height + 10;
}
}
bottom = main_mc._y+mask_mc._height-main_mc._height-50;
}
///////////////////////////////////////////////////////////////////////
// Read in XML, run some functions
//////////////////////////////////////////////////////////////////////
var k_xml = new XML ();
k_xml.ignoreWhite = true;
System.useCodepage = false;
k_xml.onLoad = function(success){
if (success){
GenerateMenu(this)
}
else{
trace ("Error loading XML file");
}
};
k_xml.load("http://www.indewulf.be/php/keuken.php");