----- Original Message ----

> From: allandt bik-elliott (thefieldcomic.com) <[email protected]>
> 
> i'd also recommend having a root node and an xml type declaration at 
> the start

Right. Ok, here's my revised code:

<?xml version="1.0"?>
<SITE>
  <PAGE pg_name='index'>
    <DETAILS>This is some more of the home page.</DETAILS>
  </PAGE>
  <PAGE pg_name='contact'>
    <DETAILS>This is some more of the contact page.</DETAILS>
  </PAGE>
</SITE>

        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();
                case "contact":
                    pageDetails = xmlData.PAGE.DETAILS.toString();
                default:
                    pageDetails = xmlData.PAGE.DETAILS.toString();
                    trace(pageDetails);
            }
            MyTextBlock();
        }

The first trace nicely prints out what I would expect (I think, should have 
been on two lines):

indexcontact

The second trace also prints:

<DETAILS>This is some more of the home page.</DETAILS>
<DETAILS>This is some more of the contact page.</DETAILS>

indicating, of course, that the default is firing. Why?
TIA,
John



      
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to