1 Reply Latest reply on Mar 23, 2007 12:12 PM by kglad

    simple sort routine for a text field

    chopTheWood Level 1
      Does anyone have an example script that will take the contents of a dynamic text field and sort it?
      Such as:
      one
      two
      three
      four
      ----will become:
      four
      one
      three
      two

      lines are separated by line breaks
      thanks

        • 1. Re: simple sort routine for a text field
          kglad Adobe Community Professional & MVP
          you can use the flash split() method of strings to form an array with each line as an element and then use the flash sort() method of arrays to sort your array elements and finally use the flash join() method of arrays to form a string that can then be assigned to the text property of a textfield for display.