Dump the textfile idea and use XML instead, which is far better suited for
stuff like menu's.
<?xml version="1.0" encoding="UTF-8" ?>
<menu>
<item label="about us" />
<item label="news" />
<item label="portfolio">
<sub label="branding" />
<sub label="interactives" />
<sub label="marks" />
</item>
</menu>
regards,
Muzak
----- Original Message -----
From: "John Trentini" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, May 05, 2007 8:56 AM
Subject: [Flashcoders] LoadVars array.length problem
> Hello,
>
> I am trying to generate two separate menus dynamically and populated by the
> content of tow text files.
>
> The text files have the following info.
>
> menuItems.txt contains:
>
> &var1=about us&
> &var2=news&
> &var3=portfolio& etc.
>
> submenuItems.txt contains:
> &var1=branding&
> &var2=interactives&
> &var3=marks& etc.
>
> these will be updateable files with any numbers of elements added to or
> removed from.
>
>
> I have this code at the root level:
>
> menuLoadVars = new LoadVars();
> menuLoadVars.load("menuItems.txt");
>
> subMenuLoadVars = new LoadVars();
> subMenuLoadVars.load("submenuItems.txt");
>
> How can I generate an array that only contains the values of each item if I
> don't know the length of the text file?
>
> I have tried:
>
> menuItems.onLoad = function(){
>
> for(i=0; i<menuItems.length; i++){
> trace(menuItemds[i]);
>
> }
>
> }
>
> but the menuItems.length is undefined and does not return a value.
>
> What can I do instead?
>
> Any tip would be a big help.
> Thanks
>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com