1 Reply Latest reply on Jun 14, 2009 5:17 PM by SiHoop

    Binding to an array

    SiHoop Level 1

      My application uses a couple of classes:TextParser and MazeMaker

       

      The main application creates textParser1 an instance of TextParser:

      private var textParser1:TextParser

      textParser1 = new TextParser(etc.)

       

      TextParser contains a public array:answersArray which is Bindable

      Within textParser, I generate a series of instances of MazeMaker:

       

      public    var mazeLayout:MazeMaker

      .

      .

      mazeLayout=new MazeMaker( etc.)

       

      answersArray[myVal]=mazeLayout.selectedAnswer

      myVal++

       

      Now, within the MazeMaker class I create selectedAnswer:

      [Bindable] public var selectedAnswer:String=""

       

      When I select a button in MazeMaker I use the following to access some content.

      selectedAnswer=event.currentTarget.getChildAt(0).text

       

      My goal is that when selectedAnswer changes its value,so too the value of answersArray[myVal] should also change its value and that should show up when I access answersArray in a function in the main application:

      trace("My value="+textParser1.answersArray)

       

      However. It doesn't work I seem to be unable to update the value of answersArray[myVal]. What can I do to correct this?

      Thanks!