Storing and using data from PHP in movieclips

Heya guys,

I’m currently having abit of problem with splitting some data and inserting it correctly.

What I’m trying to do:

On screen I am going to have 3 movieclips (with a dynTextfield already placed inside them).

Using data imported from PHP I plan to put the project names of the returned results inside the movieclips. The problem with this is if the results are more than 3 then there aren’t enough movieclips. To over come that I was thinking of using a ‘more’ button where the project names would get pushed out of the movieclips and the new set loaded in/along.

At the present moment I can split the data (received from PHP) and trace it accurately, although I’m not sure how to go about storing it now. I was going to use and Array and store to store the info and call it in the buttons, however I haven’t used arrays before.

Code


function fetchInfo(){
    //Query DB for existing projects:
    fetchProjects = new LoadVars();
    fetchProjects.userID = _global.UserID;
    fetchProjects.sendAndLoad("./php/fetchProjects.php",fetchProjects,"POST");
    fetchProjects.onLoad = function(){
        var dbResult = fetchProjects.numrows;

        for (i=1; i<=dbResult; i++) {
            trace(fetchProjects["projectID" + i]);
            trace(fetchProjects["projectName" + i]);
            trace("-----------");
        }
        //FOR TESTING PURPOSES, REMOVE LATER:
        projTest.projTitle.text = fetchProjects["projectName1"];
    }//end onLoad function
}//end fetchInfo()

At the moment in my test there are 2 results that are returned, I’m just looking for abit of assistance on the matter and be pointed in the right direction.

Hopefully I’ve done a good enough job explaining and I hope I’ve managed to get the right section, I felt this prob was more actionscript than PHP based.
Steve :thumb: