Тема: flash 8 и xml
Показать сообщение отдельно
Старый 21.09.2006, 12:10     # 1
V0land
::VIP::
рататуйло
 
Аватар для V0land
 
Регистрация: 30.11.2003
Адрес: Felwood
Пол: Female
Сообщения: 1 365

V0land Гурее всех гурых :-)
V0land Гурее всех гурых :-)V0land Гурее всех гурых :-)V0land Гурее всех гурых :-)V0land Гурее всех гурых :-)V0land Гурее всех гурых :-)V0land Гурее всех гурых :-)V0land Гурее всех гурых :-)V0land Гурее всех гурых :-)V0land Гурее всех гурых :-)V0land Гурее всех гурых :-)V0land Гурее всех гурых :-)V0land Гурее всех гурых :-)
flash 8 и xml

имеется код:

PHP код:
dataXML = new XML();
dataXML.onLoad convertXML;
dataXml.ignoreWhite true;
dataXML.load("members.xml");


function 
convertXML() {
    
mainTag = new XML();
    
elementTag = new XML();
    
dataList = new Array();
    
elementList = new Array();
    
mainTag this.firstChild;
    if (
dataXML.loaded) {
        if (
mainTag.nodeName == "Members") {
            
dataList mainTag.childNodes;
            for (
i=0i<=dataList.lengthi++) {
                if (
dataList[i].nodeName == "Member") {
                    
elementList dataList[i].childNodes;
                    for (
j=0j<=elementList.lengthj++) {
                        
elementTag elementList[j];
                        
elementType elementTag.nodeName;
                        if (
elementType == "Name") {
                            
Name elementTag.firstChild.nodeValue;
                        }
                        if (
elementType == "Section") {
                            
Section elementTag.firstChild.nodeValue;
                        }
                        if (
elementType == "DeskLocation") {
                            
DeskLocation elementTag.firstChild.nodeValue;
                        }
                        if (
elementType == "Responsibilities") {
                            
Responsibilities elementTag.firstChild.nodeValue;
                        }
                        if (
elementType == "PersonalInfo") {
                            
PersonalInfo elementTag.firstChild.nodeValue;
                            
DataStuff "<b>Name</b>: "+Name+"<br><br>"+"<b>Section: </b>"+Section+"<br><br>"+"<b>Desk Location: </b>"+DeskLocaation+"<br><br>"+"<b>Responsibilities: </b>"+Responsibilities+"<br><br>"+"<b>Personal Info: </b>"+PersonalInfo+"<br><br>";
                            
//testbox.htmlText = Name+".jpg";
                        
}
                        if (
elementType == "PicPath") {
                            
PicPath elementTag.firstChild.nodeValue;
                        }
                    }
                    
                    
listBox.addItem(NameDataStuff);
                    
listBox.sortItemsBy("label""ASC");
                    
                }
            }
        }
    }
         
    
listBox.setChangeHandler("SelectItem");
}

function 
SelectItem() {
    
infobox.text listBox.getSelectedItem().data;
    
PicPathlistBox.getSelectedItem().label+".jpg";
    
PicBox.contentPath PicPath;


проблема в том, чт если в заголовке xml файла стоит
Цитата:
<?xml version="1.0" encoding="utf-8" ?>
то ничего в листбокс не добавляется. если подтереть те две строчки, то все ок.


вопрос - что за фигня?
__________________
[ :: HeavyMetal Hamster :: ]
[ :: SPiRiT of RETRiBUTiON :: ]
V0land вне форума