2 Replies Latest reply on Feb 15, 2007 5:37 PM by jamProg

    Array vs Array Collection

    jamProg
      I am just trying to bind to the various indices of my array.

      I get a caution saying that:
      quote:

      Data binding will not be able to detect changes while using square brackets


      Flex Builder suggests using ArrayCollection and getItemAt instead.
      It seems to work fine with the array. Is it necessary to use this for a simple list?

      Here is my code:

      // This is in the script
      [Bindable]
      public var categories:Array = ["red","blue"];

      <!-- In the xml -->
      <mx:Label width="50%" color="blue" id="eocCCLabel"
      text="{categories[0]}" click="checkInput(0,eocCCLabel,eocCCFB,eocCC,feedbackStack)"/>
      <mx:Label width="100%" color="blue" id="eocSLabel"
      text="{categories[1]}" click="checkInput(1,eocSLabel,eocSFB,eocS,feedbackStack)"/>

      Thanks
      -Alexei