I dont know why but I cant ever seem to get my xml working right the first time…
myxml:
<?xml version="1.0" encoding="utf-8"?>
<categories>
<featured>
<image src="logo1.jpg" />
<image src="logo2.jpg" />
<image src="logo3.jpg" />
</featured>
<entertainment>
<item title="Chandler Hall Movie" />
<item title="DTL Video Magazine" />
<item title="Edmond the Film" />
<item title="First Independent Pictures" />
<item title="Metro Models" />
<item title="Resting Bird Ent." />
<item title="Sugar Hooker Ent." />
</entertainment>
<fashion>
<item title="Atticus Clothing" />
<item title="Bad Boy Brands, Intl." />
<item title="Brixton" />
<item title="Cast Off Clothing" />
<item title="Clutchwear" />
<item title="Coastal Customs" />
<item title="Converted Mentality" />
<item title="Defrez" />
<item title="Iron Royalty" />
<item title="Loserkids.com" />
<item title="Macbeth Shoes" />
<item title="Major Label Clothing" />
<item title="SEZN Clothing" />
<item title="Sun Diego" />
<item title="Tiedup Clothing" />
</fashion>
<actionsports>
<item title="Allodic Marketing" />
<item title="ASAN" />
<item title="Bloodshot" />
<item title="Boost Mobile" />
<item title="Interaction Netwerx" />
<item title="NC Hypersports" />
<item title="Pharmacy Boardshop" />
<item title="Racewerks" />
<item title="RiderSupport.net" />
<item title="Sanuk" />
<item title="Spy Optic" />
<item title="Universal Ramp" />
<item title="Utopia Optics" />
<item title="XCEL Wetsutis" />
</actionsports>
<music>
<item title="Action Reaction" />
<item title="Angels and Airwaves" />
<item title="Big Blue Hearts" />
<item title="BIg Dume" />
<item title="Blinded Black" />
<item title="CDPresale.com" />
<item title="Collective Soul" />
<item title="Daredevil Jane" />
<item title="Drive Thru Records" />
<item title="Equal Vision Records" />
<item title="Eric Hutchinson" />
<item title="F. B. March of Flames" />
<item title="Fenix TX" />
<item title="Futura Online Stores" />
<item title="Geffen Records" />
<item title="Hazen Street" />
<item title="Koala Records" />
<item title="Kut u Up" />
<item title="Manaloft Records" />
<item title="Motion City Soundtrack" />
<item title="My American Heart" />
<item title="Point 1" />
<item title="PunkRockVids.com" />
<item title="Rocket Science" />
<item title="Rowboat Records" />
<item title="Sidecho Records" />
<item title="Suretone Records" />
<item title="Taking Back Sunday" />
<item title="The After Party" />
<item title="The Plug Uglies" />
<item title="Tommy Lee" />
<item title="Years Around The Sun" />
<item title="You in Series" />
<item title="Yovee" />
</music>
<misc>
<item title="Av-Air Parts" />
<item title="Big Boy Scooters" />
<item title="David Kaye" />
<item title="Define Motorworks" />
<item title="Endless Possiblities" />
<item title="ezGDS Travel" />
<item title="Fashion Careers College" />
<item title="Fumari" />
<item title="Globaljet Corp." />
<item title="G.A.T." />
<item title="Define Motorworks" />
<item title="Guru Tattoo" />
<item title=" I Design" />
<item title="Jennifer Delonge" />
<item title="Littletown MX" />
<item title="Loudshot Media" />
<item title="Mailcall" />
<item title="Mudge Fasteners" />
<item title="Media Doctors" />
<item title="Passey Bond" />
<item title="Photography by Jade" />
<item title="Precision Litho" />
<item title="Rad2go" />
<item title="Richard Elias" />
<item title="RockemSockem.com" />
<item title="SD Realty Brokerage" />
<item title="Slingshot Interactive" />
<item title="Snap" />
<item title="Today is a New Day" />
<item title="Versicolor" />
<item title="Zancopages" />
</misc>
</categories>
my code to access it:
var listlength = _root.listxml.firstChild.firstChild.childNodes.length;
trace(listlength);
That works fine. It reads the first node though so it outputs 3. I need to be able to access the other nodes like for example I am trying to access the entertainment node so I figured
var listlength = _root.listxml.firstChild.firstChild[1].childNodes.length;
trace(listlength);
would work but it comes back undefined…any suggestions?