[FMX] Not reading XML Object

Hi all,

I’ve made a little application in Flash so my clients can update their website without me. However, I’m having problems with one part. I allow the user to create a new ‘project’ on one screen where they can then add details, pictures, videos about it on the next screen. The add project button has this script to add the node and the default details:

  on (release) {
      // Adds the project.
      _root.projectXml.firstChild.appendChild(_root.projectXml.createElement("projectNode"));
      // Creates the default details.
      _root.projectXml.firstChild.lastChild.attributes.title = addproject;
      _root.projectXml.firstChild.lastChild.attributes.videoUrl = "Not yet defined.";
      _root.projectXml.firstChild.lastChild.attributes.credittitle = "Enter the credit titles here (e.g. Director, Designer).";
 _root.projectXml.firstChild.lastChild.attributes.creditname = "Enter the names here. Format as you would like to see on the website.";
 // Adds the sub bit where the picture URLs are stored. _root.projectXml.firstChild.lastChild.appendChild(_root.projectXml.createElement("pics"));
      // This is the variable which tells Flash which project in the list is being
      // dealt with.
      _root.selectproject = _root.projectsXml.length;
      // This takes us to the screen where the user can edit the details.
      _root.gotoAndStop("edit");
      // Closes the popup window.
      this._visible = false;
      }

However, when it goes to the ‘edit’ screen, all the dynamic text fields displaying the data read ‘undefined’. However, once the program is restarted and the project is selected and taken to the edit screen, all the fields display the correct information. The code for the frame which pulls in the information is:


     titlefield.inputtext = projectsXml[selectproject].attributes.title;
     moviefield.inputtext = projectsXml[selectproject].attributes.videoUrl;
     creditseditbox.editcreditsinput.credittitle = projectsXml[selectproject].attributes.credittitle;
     creditseditbox.editcreditsinput.creditname = projectsXml[selectproject].attributes.creditname;
     
Cheers for any light that can be shed on this. I can't work it out myself.

ben