>> Now, how can I build a switch statement to determine which page? Did you read my reply? I didn't see a response to it.
Jason Merrill Bank of America Global Learning Learning & Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -----Original Message----- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of John Singleton Sent: Wednesday, May 05, 2010 1:28 PM To: Flash Coders List Subject: Re: [Flashcoders] XML Question ----- Original Message ---- > From: "kennethkawam...@gmail.com" <kennethkawam...@gmail.com> > To: Flash Coders List <flashcoders@chattyfig.figleaf.com> > Sent: Wed, May 5, 2010 12:48:28 PM > Subject: Re: [Flashcoders] XML Question > > Say for example you are in the home section and obtaining the data for it, > you'd do: > var pageData:XML = xmlData.PAGE.(@pg_name == "index")[0]; > > Then build the page based on pageData XML. k. Now, how can I build a switch statement to determine which page? I plan to pass a var to my swf, then call the data based on the value of the var (in this case, "index"). As stated previously, my switch statement, for reasons I don't understand, is giving me the value "indexcontent"; that is, all the values of pg_name: function completeXMLListener(e:Event):void { var xmlData:XML = XML (e.target.data); trace(xmldata.pa...@pg_name.tostring()) switch (xmldata.pa...@pg_name.tostring()) { case "index": pageDetails = xmlData.PAGE.DETAILS.toString(); break; case "contact": pageDetails = xmlData.PAGE.DETAILS.toString(); break; default: pageDetails = xmlData.PAGE.DETAILS.toString(); trace(pageDetails); break; } MyTextBlock(); } TIA, John _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders