IMHO.WS

IMHO.WS (http://www.imho.ws/index.php)
-   Веб-программирование (http://www.imho.ws/forumdisplay.php?f=29)
-   -   flash 8 и xml (http://www.imho.ws/showthread.php?t=108613)

V0land 21.09.2006 12:10

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" ?>

то ничего в листбокс не добавляется. если подтереть те две строчки, то все ок.


вопрос - что за фигня? :confused:

Pavlenty111 27.09.2006 18:23

dataXml.ignoreWhite = true; ---> dataXML.ignoreWhite = true;


Часовой пояс GMT +4, время: 13:14.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.