2 Replies Latest reply on Mar 17, 2009 7:19 AM by Gregory Lafrance

    How to group UI components into an array in MXML

    KhoaNgo
      Hi all,

      I'm new in Flex. I want to group UI components into an array in MXML, but I don't know how to do so. Pseudo code looks like following:

      <mx:Text id="arrayItems[]"/>
      <mx:Text id="arrayItems[]"/>
      <mx:Text id="arrayItems[]"/>

      In AS3, I would like to execute a method as follows:

      <mx:Script>
      <![CDATA[
      private function setTextFields():void {
      for (var i:int = 0; i < arrayItems.length; i++) {
      arrayItems[ i ].text = "Text " + i;
      }
      }
      ]]>
      </mx:Script>

      Anybody please help me to correct the MXML code above.
      Thanks alot,
      KhoaNgo