Hi folks,
Can anyone please let me know why I get the error : "1046:
Type was not found or was not a compile-time constant: Contact"
on this line :
public var contact:Contact; in my Flex 2 app example which I
am following at
http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Pa...I have followed the tut so far down to the letter, but still
no joy.
I have the following setup:
1) flex 2 data services setup at :
2) copied the structure as required for Contact.as - this
file is in the folder
C:\fds2\jrun4\servers\default\samples\DSLessons\samples\contact\Contact.as
which as far as I can tell is correct. The contents of contact.as
is straight from Adobe :
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2003-2006 Adobe Macromedia Software LLC and
its licensors.
// All Rights Reserved.
// The following is Sample Code and is subject to all
restrictions on such code
// as contained in the End User License Agreement
accompanying this product.
// If you have received this file from a source other than
Adobe,
// then your use, modification, or distribution of it
requires
// the prior written permission of Adobe.
//
////////////////////////////////////////////////////////////////////////////////
package samples.contact
{
[Managed]
[RemoteClass(alias="samples.contact.Contact")]
public class Contact
{
public var contactId:int;
public var firstName:String = "";
public var lastName:String = "";
public var address:String = "";
public var city:String = "";
public var state:String = "";
public var zip:String = "";
public var phone:String = "";
}
}
!!
the mxml is :
<?xml version="1.0" ?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"> <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;
]]>
</mx:Script>
<mx:DataGrid id="dg" 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>
as you can see, I have not even completed it yet !!!!
any help would be appreciated.
Thanks
Smak