1 Reply Latest reply on Jun 3, 2007 9:16 AM by sandersky

    List Data To Text

    sandersky
      I am pretty new to Flex and I am having trouble getting data from a List to fill Text when the list item is clicked.
      Here is my code:

      <mx:Script>
      <![CDATA[
      private function ListDescription():void {
      ItemDescription.text=myList.dataProvider.@data;
      }
      ]]>
      </mx:Script>
      <mx:List bottom="30" change="ListDescription()" id="myList" labelField="@label" left="6" top="6" width="120">
      <mx:dataProvider>
      <mx:XMLList id="myListData">
      <node data="Item 1 Description." label="Item 1"/>
      <node data="Item 2 Description." label="Item 2"/>
      <node data="Item 3 Description." label="Item 3"/>
      <node data="Item 4 Description." label="Item 4"/>
      <node data="Item 5 Description." label="Item 5"/>
      <node data="Item 6 Description." label="Item 6"/>
      <node data="Item 7 Description." label="Item 7"/>
      </mx:XMLList>
      </mx:dataProvider>
      </mx:List>
      <mx:Text bottom="30" id="ItemDescription" left="132" right="6" text="Please choose an item to the left." top="6"/>