----- Original Message ----

> From: "[email protected]" <[email protected]>
> To: Flash Coders List <[email protected]>
> 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
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to