4 Replies Latest reply on Jul 13, 2010 7:31 AM by boneitis

    Add an item from text field into an Array

    djh88ukwb Level 1

      Hello all,

       

      I have the following array

       

                  [Bindable] private var questionsArr:ArrayCollection = new ArrayCollection(
                          [{question:"What are your hobbies", start:"1", stop:"3"},
                          {question:"What work experience do you have", start:"4", stop:"7"},
                          {question:"How long have you lived in Wales", start:"8", stop:"9"}]);

       

      And then I have three text fields

       

              <s:TextInput x="10" y="10" width="426" id="txt_Question" change="showSave_btn(event)"/>

              <s:TextInput x="140" y="39" text="" id="lbl_StartTime" borderVisible="false" editable="false"/>
              <s:TextInput x="140" y="69" text="" id="lbl_FinishTime" borderVisible="false" editable="false"/>

       

      Once these three fields have data in them a "Save" button is shown,  at the moment this "Save" button resets the values of the textinputs back to nothing.  But what i want it to do is add the three values into the array.

       

      So that ultimatley i will be able to add like 5 questions, start and finish times to the array all from the one set of textinputs,

       

      Can anyone help me with this please?