PDA

View Full Version : External file in Dyn Menu


babaloui
02-16-2004, 03:30 PM
hi all,
My question regarding this tutorial:
http://www.actionscripts.org/tutorials/intermediate/Dynamic_menu_with_submenus/index.shtml

it wroks fine, BUT I want to Load External Text File with

loadVariablesNum("items.txt", 0, "POST");


BUT does not work with External File at all
Can you tell me how can I use the text file to load the items to the MENU?


// to be replaced by extrenal text file.
// menu items
total = 11;
text1 = "home";
text2 = "dogs";
text3 = "cats";
text4 = "rabbits";
text5 = "hamsters";
text6 = "rats";
text7 = "mice";
text8 = "guinea pigs";
text9 = "ferrets";
text10 = "chinchillas";
text11 = "monkeys";
// submenus
subText2 = 2;
stext21 = "puppies";
stext22 = "adult";
subText4 = 2;
stext41 = "short hair";
stext42 = "long hair";


I have this TEXT FILE :
&total = 11&text1 = home&text2 = dogs&text3 = cats&text4 = rabbits&text5 = hamsters .... ETC

CyanBlue
02-16-2004, 03:55 PM
Howdy and Welcome... ;)

If you use loadVariablesNum() function, you'd need to have some sort of loop that will make sure that you are getting the value from the external file... If you have to use loadVariablesNum() function, search for the 'swonking' within the forum...

Better way of handling it would be using the onLoad handler of LoadVars() object... That's whole lot easier but you cannot export that into F5... I think there is LoadVars() tutorial on our tutorials section...

Lastly, you should not have space between '=' sign within your text file... So, your text file should be looking like...

&total=11&text1=home&text2=dogs&...

babaloui
02-16-2004, 11:24 PM
hi Cyan,
your answer made me confused!!!
do you want me to search all forums for 'swonking'?are you serious man?
I came to this forum for help....

and its not matter of spaces between = ,

I prefered if you test the Movie before posting...
this Movie doesnt work with External File at all for any reason because it did nt design to do that.