I followed the tutorial on here (http://www.kirupa.com/developer/as3/classes_as3_pg1.htm)
I have 2 files. test.fla and test.as in the same folder. test.fla has one layer and one frame only. the code is place on this frame on the main timeline.
test.as code
package
{
public class Name
{
private var firstName:String;
private var lastName:String;
function Name()
{
}
public function SetFirstName(val:String):void
{
firstName = val;
}
public function SetLastName(val:String):void
{
lastName = val;
}
public function GetFullName():String
{
return firstName + " " + lastName;
}
}
}
test.fla code
var test:Name=new Name();
returns this
1046: Type was not found or was not a compile-time constant: Name.
1180: Call to a possibly undefined method Name.