3 Replies Latest reply on Aug 10, 2011 2:44 PM by kglad

    How do you get incremented xml data in a for statement?

    Rabel Level 1

      Hello,

      I am importing data using xml and getting incremented data that looks like this

       

      peopleObject.name0

      peopleObject.phone0

      peopleObject.image0

      peopleObject.name1

      peopleObject.phone1

      peopleObject.image1

       

      And now i am trying to use that information using a for statement but i do not know how i can add the incremented number at the end. I tried to add a "+i" like this

       

      for(var i=0; i <= peopleTotal ;i++){
           var newMC:MovieClip = placeHolder.attachMovie("peopleMovie", "peopleMovie_"+i, i);     
           newMC._x = 100;
           newMC._y = ya;
           newMC.peoplename.text = peopleObject.name+i;
                trace(peopleObject.name+i+ " name+i")
           newMC.peopleimg = peopleObject.image+i;
           ya += newMC._height;
      }

       

      So any idea how can I access the data that is in an incremented variable in a seperate for statement? Let me know if i didnt explain good enough.

       

      Thanks,

      Randy