3 Replies Latest reply on Feb 25, 2016 7:03 AM by kglad

    Allowing a user to enter data into an array.

    liamfrancis2013 Level 1

      I have created a random name picker which basically allows you to enter a list of names into an array and will randomly choose one when i click a button.

      Code Below:


      var nameArray:Array = new Array("name 1", "name 2", "name 3", "name 4", "name 5");

      function getName(){

      var ranNum = random(nameArray.length);

      var randomName = nameArray[ranNum];

      Text_txt.text = randomName;


      Button_btn.onPress = function(){




      Anyways, i want to make it so the user is able to enter the list into the array without having to go into action script. So it operates exactly like this:

      ClassTools.net Interactive Learning Tool


      Any ideas how i'd go about this?


      I am currently using AS2 in Adobe Flash Professional CS5.