3 Replies Latest reply on Mar 13, 2010 4:27 PM by kglad

    Help With Loop

    TheBrody

      I'm trying to make it so every item thats in an array. It will set the text of a button to the thing in the array.

       

       

      QuestNames = new Array("Tutorial Island", "Rare Shopping");

       

      for(i=0; i<QuestNames.length; i++){
          QuestBox.mcContents.quest[i].questname1.text = QuestNames[i];
      }

       

      The buttons are called quest1, quest2, quest3, etc..

       

      What it should be doing is setting the button's text to the thing in the list.

      So for the 1st button it sets it to "Tutorial Island".

      Then the 2nd would be "Rare Shopping".


      And so on..

       

      ... How can I get this to work?

       

      Edit:

      I tried doing QuestBox.mcContents.quest0.questname1.text = "Hey"

      And that didn't even work.