I just tried your code and it works fine for me. Can you elaborate on
the problem you're having?
.m
On Wed, Aug 27, 2008 at 10:54 AM, Vayu Robins <[EMAIL PROTECTED]> 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