Yes, it should be child.title instead, and I am sure I tried that many a
times, but for some reason it only works after posting it on the forum. He
he.

Thanks for your help nevertheless Kenneth and Matt.


On 8/27/08 5:18 PM, "Kenneth Kawamoto" <[EMAIL PROTECTED]> wrote:

> Shouldn't it be "trace(child.title);" instead?
> 
> Kenneth Kawamoto
> http://www.materiaprima.co.uk/
> 
> Vayu Robins wrote:
>> Hi.
>> 
>> I am trying to build a dynamic menu system with unlimited submenus.
>> 
>> I have this from Colin Moock's book (Essential AS3) and it works fine.
>> 
>> var xml:XML =  
>>     <course>
>>         <section>
>>             <title>Menu1</title>
>>             <section>
>>                 <title>Menu1 - Sub</title>
>>                 <section>
>>                     <title>Menu1 ­ Sub Sub</title>
>>                 </section>
>>             </section>
>>         </section>
>>     </course>;
>> 
>> var xmlList:XMLList = xml.children();
>> parseStructure(xmlList);
>> function parseStructure(xml:XMLList):void
>> {
>>     for each (var child:XML in xml)
>>     {
>>         trace(xml.title);
>>         if (child.section != null) parseStructure(child.section);
>>     }
>> }
>> 
>> The problem for me arises when I add another section of menus like this:
>> 
>> var xml:XML =  
>>     <course>
>>         <section>
>>             <title>Menu1</title>
>>             <section>
>>                 <title>Menu1 - Sub</title>
>>                 <section>
>>                     <title>Menu1 ­ Sub Sub</title>
>>                 </section>
>>             </section>
>>         </section>
>> 
>>         <section>
>>             <title>Menu2</title>
>>             <section>
>>                 <title>Menu2 - Sub</title>
>>                 <section>
>>                     <title>Menu2 ­ Sub Sub</title>
>>                 </section>
>>             </section>
>>         </section>
>>     </course>;
>> 
>> Is it the xml that is wrong?
>> 
>> Thanks
>> Vayu 
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



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

Reply via email to