1 Reply Latest reply on Jan 31, 2007 10:16 PM by Robert S

    data assignment

    Robert S
      I have a component for an <mx:List /> that I have built. The problem I am having is that I have a class that I would like to assign the variables withing the component as well as have the labels show some data of the dataprovider (currently an ArrayCollection).

      The problem is that the assignment variable declaration (_person.name = data.Name) in the initThis() throws a null exception while the data.Name in the bindable section of the LinkButton's lable property works fine. Any help would be greatly apprecieated.

      Sample:

      <mx:HBox xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="initThis()" >
      <mx:Script>
      <![CDATA[
      import dto.Person;

      [Bindable] private var _person:Person;

      private function initThis():void{
      _person = new Person();

      _person.name=data.Name;
      }
      ]]>
      </mx:Script>
      <mx:LinkButton label="{data.Name}" width="25%" click="{mx.controls.Alert.show('You clicked: '+_person.name)}"/>
      </mx:HBox>