2 Replies Latest reply on Oct 7, 2009 10:10 AM by Closeminded_pj

    Two part question.... Scrolling multiple text fields via 1 scroll bar. Removing commas from being displayed in array list.

    Closeminded_pj

      I have been scripting this flash profile card which pulls data from multiple XML files. The problem i am having is when it comes down to pulling this 1 set of information which is accessing the attributes of an array of specific XML nodes on display after the first item it inputs a comma before each item.

       

       

      My code:

      -------------------------------------------------------------------------

      xmlData = new XML ();
      xmlData.ignoreWhite = true;
      xmlData.onLoad = loadXML;
      xmlData.load ("../xml profiles/test.xml");

      --------------------------------------------------------------------------

      function loadXML (loaded)
      {
      if (loaded)
      {
        xmlNode = this.firstChild;

        image = [];

        id_array = [];
        total = xmlNode.childNodes.length;
        for (i = 0; i < total; i++)
        {

      image[i] = "../people/photos/" + xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue + ".jpg";

      id_array[i] = xmlNode.childNodes[i].childNodes[10].childNodes;
        }
        firstImage ();
      }
      else
      {
        content = "file not loaded!";
      }

      -------------------------------------------------------------------------
      }

      function firstImage ()
      {
      if (loaded == filesize)
      {
        picture._alpha = 0;
        picture.loadMovie (image[0],1);
        associate_array = id_array[0];
        populateLists (associate_array);
        picture_num ();
      }
      }

      ---------------------------------------------------------------------

      function populateLists (xml_array)
      {
      identification = [];
      associatelist = [];
      locationlist = [];
      for (n = 0; n < xml_array.length; n++)
      {
        var identnumber = xml_array[n].attributes;
        identification[n] = identnumber.occurence + "\n";
        associatelist[n] = identnumber.associate + "\n";
        locationlist[n] = identnumber.Location + "\n";
        occurence_txt.text = identification;
        associate_txt.text = associatelist;
        location_txt.text = locationlist;
      }
      }

      The red code is the data being displayed with commas after the first item. I could not find a solution anywhere... but saw discussion about nested arrays commonly displaying commas.

       

      example.jpg

      This is just a draft version of the layout i used to pull up fake data... to show the commas.

       

      If anyone knows how to remove the commas that would be great.

       

      Lastly i am wondering if it is possible to control the 3 text fields using 1 scroll bar or would i be better off learning how to create columns in 1 text field to display these lists.

       

      Thanks in advance!

       

      ...some day i will need to learn AS3