Groups | Blog | Home
all groups > flash (macromedia) > march 2004 >

flash (macromedia) : Dynamic Menu Using LoadVars Object


skaiwayne
3/24/2004 10:23:31 PM
Im loading an ASP file from the Database and the bringing it into flash using
LoadVars object. Im trying to create a dynamic menu the asp file looks like
this:
&menutxt=ABOUT,CONTACT,PHOTO GALLERY,GUEST BOOK,LINKS,
In flash Im using an Array like this:

dataObj = new LoadVars();
dataObj.onLoad = function(success) {
if (success) {
buttonNames = dataObj.menutxt
buttonNames = new Array();
split(buttonNames, ",")

i = 0;
while (i < buttonNames.length) {
trace(buttonNames)
i++;
}
dataObj.load("http://localhost/flashdb/send.asp");

When I use this code on the Vars Object It will keep the same format:
ABOUT,CONTACT,PHOTO GALLERY,GUEST BOOK,LINKS,

But I just create an array and put the above information in it, It will split
and write out correctly.

Can anyone see whats up?
rmw82
3/24/2004 10:29:35 PM
I hope I understand your question properly.

Try this:
buttonNames = new Array();
dataObj = new LoadVars();
dataObj.onLoad = function(success) {
if (success) {
buttonNames = split(dataObj.menutxt, ",")
i = 0;
while (i < buttonNames.length) {
trace(buttonNames)
i++;
}
dataObj.load("http://localhost/flashdb/send.asp");

Hope that helps,

Rob

Please make sure that you post the solution, if found, to help others with a
similar problem.

AddThis Social Bookmark Button