A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: What am i doing wrong -loading XML

  1. #1
    The Great euh eh you know paul67's Avatar
    Join Date
    Oct 2000
    Location
    the Netherlands
    Posts
    283

    What am i doing wrong -loading XML

    hi there,

    the following script does not function:
    I hope that someone can help me.
    It loads ok, but with the attributes something goes wrong
    Code:
    function verwerk(succes){
    	if (succes) {
    		//hier de xml omzetten in array's of objects
    		klijst.firstChild();
    		    _parent._parent.blad.text = "letop: ";
    		trace(kLijst.childNodes.length);
    		
    		for(i=0;i<=kLijst.childNodes.length;i++){
    			test=kLijst.childNodes[i];
    			trace(test.attributes.titel);
    
    	         _parent._parent.blad.text+=test.attributes.titel;
    		}
    		
    	}
    }
    function layout() {
    	// deze functie zorgt ervoor dat alles op zijn plek komt	
    }
    
    
    check=0;
    kLijst = new XML();
    kLijst.ignoreWhite = true;
    kLijst.onLoad = verwerk;
    kLijst.load("kladblok.xml");
    
    stop();
    I use the followiong xml:
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <kladblok>
    <item titel="new" tekst="bla bla bal blabal balbla"></item>
    <item titel="nieuwer" tekst="bla bla bal bal balbla"></item>
    </kladblok>
    thanks
    Paul
    the Netherlands
    Flash Fool
    .. or ..
    fooled flasher

  2. #2
    The Great euh eh you know paul67's Avatar
    Join Date
    Oct 2000
    Location
    the Netherlands
    Posts
    283
    I found the fault

    i forgot the first born child:
    Code:
    test=kLijst.firstChild.childNodes[i];
    Paul
    the Netherlands
    Flash Fool
    .. or ..
    fooled flasher

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center