0 Replies Latest reply on Jan 26, 2007 2:37 PM by RL2007

    Problem with Lesson "Build a distributed application with the Java adapter "

    RL2007
      I'm getting a compliation error with the line "public var contact:Contact;" in the code below.
      The error is "1046: Type was not found or was not a compile-time constant: Contact."

      <?xml version="1.0" ?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="initApp();">

      <mx:Script>
      <![CDATA[
      import mx.data.DataService;
      import mx.collections.ArrayCollection;
      import samples.contact.Contact;
      public var ds:DataService;

      [Bindable]
      public var contacts:ArrayCollection;
      public var contact:Contact;

      public function initApp():void {
      contacts = new ArrayCollection();
      ds = new DataService("contact");
      ds.fill(contacts);
      }
      ]]>
      </mx:Script>

      <mx:DataGrid id="dg" dataProvider="{contacts}" editable="true">
      <mx:columns>
      <mx:DataGridColumn dataField="contactId" headerText="Id" editable="false"/>
      <mx:DataGridColumn dataField="firstName" headerText="First Name" />
      <mx:DataGridColumn dataField="lastName" headerText="Last Name"/>
      </mx:columns>
      </mx:DataGrid>
      </mx:Application>