----- Original Message ----

> From: "kennethkawam...@gmail.com" <kennethkawam...@gmail.com>
> To: Flash Coders List <flashcoders@chattyfig.figleaf.com>
> Sent: Wed, May 5, 2010 11:53:53 AM
> Subject: Re: [Flashcoders] XML Question
> 
> It's not just about missing "break", your switch statement
fundamentally does 
> not make sense (sorry ;)
switch (
> ymailto="mailto:xmldata.pa...@pg_name.tostring"; 
> href="mailto:xmldata.pa...@pg_name.tostring";>xmldata.pa...@pg_name.tostring())
... 
> this evaluates to "indexcontact" as your trace shows, therefore
none of your 
> cases will pass the test.

> In order to make this work you have to iterate 
> nodes with for/for
> each, but no need to even do that - instead use E4X to 
> access nodes
> you want.

Right. That's what I said at the outset, that I knew I was doing something 
fundamentally wrong, but don't know how to do it correctly. Here I am with 
Moock trying to figure it out but I'm missing it. Could you give an example?
TIA,
John

-- 
Kenneth 
> Kawamoto
http://www.materiaprima.co.uk/

On 5 May 2010 16:23, jonathan 
> howe <
> href="mailto:jonathangh...@gmail.com";>jonathangh...@gmail.com> 
> wrote:
> You forgot your break; statements, sir.
>
> On Wed, 
> May 5, 2010 at 11:12 AM, John Singleton
> <
> ymailto="mailto:johnsingleton...@yahoo.com"; 
> href="mailto:johnsingleton...@yahoo.com";>johnsingleton...@yahoo.com>wrote:
>
>> 
> ----- Original Message ----
>>
>> > From: allandt 
> bik-elliott (
> href="http://thefieldcomic.com";>thefieldcomic.com) <
> ymailto="mailto:alla...@gmail.com"; 
> href="mailto:alla...@gmail.com";>alla...@gmail.com>
>> 
> >
>> > 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(
> ymailto="mailto:xmldata.pa...@pg_name.tostring"; 
> href="mailto:xmldata.pa...@pg_name.tostring";>xmldata.pa...@pg_name.tostring())
>> 
>            switch (
> href="mailto:xmldata.pa...@pg_name.tostring";>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

> href="mailto:Flashcoders@chattyfig.figleaf.com";>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

Reply via email to