PDA

View Full Version : addItemAt() is not adding :(


Paul Ferrie
02-25-2006, 05:09 PM
Spent the past hour trying diffrent things but still i can tget it to populate the dd menu.

The data:

clientLastName7=ferrie&clientFirstName7=paul&clientID7=7&clientLastName6=Jobs&clientFirstName6=Leah&clientID6=6&clientLastName5=Cole%202&clientFirstName5=Kyla&clientID5=5&clientLastName4=Cole&clientFirstName4=Kyla&clientID4=4&clientLastName3=vbn&clientFirstName3=vbnb&clientID3=3&clientLastName2=McAleer&clientFirstName2=Michael&clientID2=2&clientLastName1=McAleer&clientFirstName1=Michael&clientID1=1&numRows=7

The code to populate dd menu

myClientList = new LoadVars ();
myClientList.onLoad = function () {
placeMyClientList ();
};
myClientList.load (path2php + "clients.php?cat_type=m");
placeMyClientList = function () {
clientList.addItemAt (0, "Select a client", 0);
count = 1;
trace ("my clients=" + myClientList);
for (var i = 0; i < myClientList.numRows; i++) {
clientList.addItemAt (count, eval ("myClientList.clientFirstName" + (count)) + " " + eval ("myClientList.clientLastName" + (count)), eval ("myClientList.clientID" + (count)));
count++;
}
};


Anyone see what i am missing?

Thanks

Paul Ferrie
02-26-2006, 08:31 AM
Anyone???

tg
02-27-2006, 04:37 PM
the first thing i would to is trace(numrows++) to see if it comes up as NaN.
next i would add an ampersand (&) after numrows=7 in your data. that will clear out any unsean data like carriage returns and linefeeds.
if numrows is nan, then your for loop isn't going to run.

Paul Ferrie
02-28-2006, 12:10 PM
All thew code worked fine. As it turns out the swf with the ddmenu was being loaded into another movie with the loadMovieNum method. I changed this to the loadMovie() and thats when the problem started. I have since changed it back and it works fine now. In saying that i do prefer the loadMovie() method over the loadMovieNum() method.