Im having some problems loading an XML file into flash. The client
inserts in the databse some elements and then an ASP page creates the
xml file and flash reads it.

The problem is that sometimes the flash tells me "undefined"

i go to the database and the data is there..but in xml file it isnt.

There are some other sections of the website that uses the same
method, and its working good...

here have too URLs(one empty and other with info)

http://www.celeiro-dieta.pt/ementa2.xml
http://www.celeiro-dieta.pt/ementa.xml

Here is the code that i use in flash:

//XML


ementa_xml = new XML();
_root.myEmenta = new Array();
ementa_xml.load("ementa2.xml");
ementa_xml.onLoad = startEmenta;
ementa_xml.ignoreWhite = true;
_root.main11.ementa_txt = "";


function startEmenta(success_ementa) {
        
        if (success_ementa == true) {
                rootNode_ementa = ementa_xml.firstChild;
                totalEmenta = rootNode_ementa.childNodes.length;
                firstEmenta = rootNode_ementa.firstChild;
                currentEmenta = firstEmenta;
                tituloEmenta = currentEmenta.attributes.titulo_ementa;
                currentIndex_ementa = 1;
                dia_ementa = parseInt(currentEmenta.attributes.Dia,10);
                dia_txt.text = dias[dia_ementa];
                _root.main11.ementa_txt = _root.main11.ementa_txt+"<font
color='#328828' size='12'><b>"+tituloEmenta+"</b></font><br>";
                
                for (a=1; a<=totalEmenta; a++) {
                        if (tituloEmenta != undefined) {
                                if ((tituloEmenta) == 
(currentEmenta.attributes.titulo_ementa)) {
                                        _root.main11.ementa_txt =
_root.main11.ementa_txt+currentEmenta.attributes.texto_ementa+"<br>";
                                } else {
                                        tituloEmenta = 
currentEmenta.attributes.titulo_ementa;
                                        _root.main11.ementa_txt = 
_root.main11.ementa_txt+"<font
color='#328828'
size='12'><b>"+currentEmenta.attributes.titulo_ementa+"</b></font><br>"+currentEmenta.attributes.texto_ementa+"<br>";
                                }
                        }
                        currentEmenta = currentEmenta.nextSibling;
                        _root.main11.caixa._height += 100;
                }
        }
}
///XML END
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to