A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Basic XML Problem

Threaded View

  1. #1
    Junior Member
    Join Date
    Jan 2006
    Posts
    18

    Basic XML Problem

    hi,

    im new to xml in flash. im having a problem parsing my end nodes (in the second level) in the xml file i have, howevever if i have the nodes on the first level, they get parsed fine. Here is my XML file:

    HTML Code:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <mapdata>
    	<gridTile count="0" height="15">
    		<obj level="1" item="ftWhite" direction="0"/>
    		<obj level="2" item="ftWhite" direction="0"/>
    		<obj level="3" item="ftWhite" direction="0"/>
    		<obj level="5" item="ftWhite" direction="0"/>
    		<obj level="6" item="ftWhite" direction="0"/>
    		<obj level="7" item="ftWhite" direction="0"/>
    		<obj level="9" item="ftWhite" direction="0"/>
    	</gridTile>
    	<gridTile count="1" height="25">
    		<obj level="1" item="ftWhite" direction="0"/>
    		<obj level="6" item="ftWhite" direction="0"/>
    		<obj level="7" item="ftWhite" direction="0"/>
    		<obj level="8" item="ftWhite" direction="0"/>
    		<obj level="9" item="ftWhite" direction="0"/>
    	</gridTile>
    </mapdata>
    Now im using this Flash 8 XMLConnector to connect to my data1.xml file. then i load the schema for the xml connector from this same file. In the binding tab of a data set, i set the bound to property for dataProvider as:

    Code:
    xmlConnector:results.mapData.gridTile
    Now the thing is that when after triggering the xml connector, when i trace the output of:

    Code:
    trace(dataSet.items[0].count);
    i get

    Code:
    0
    which is absoulutely right, but when i trace the output of

    Code:
    trace(dataSet.items[1].obj[0]);
    HTML Code:
    <obj level="1" item="ftWhite" direction="0" />
    got any clue why im getting 'undefined' when i write

    Code:
    trace(dataSet.items[1].obj[0].level);
    Attached Images Attached Images

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