Search code examples
actionscript-3apache-flexflex4flash-builderflashdevelop

Type was not found or was not a compile-time constant: Custom Class after switching IDEs


It seems that this is a fairly common error, but I was not able to find a solution for my exact problem. I was originally working in FlashBuilder, but my free trial expired and so I am attempting to switch to flashDevelop. Everything would build just fine in FlashBuilder, but I keep getting errors in FlashDevelop I have a custom class called MyCustomClass which extends EventDispatcher. I'm not allowed to be too specific with code, as this is for work, but I have something similar to this:

package myPackage{

    import myPackage.MyCustomClass;

    public class SecondClass extends EventDispatcher{


        private var _fields:Vector.<MyCustomClass>;


        [Bindable("fieldsChanged")]
            public function get fields(): Vector.<MyCustomClass> { return _fields.slice(); }
    }
}

I get the error Type was not found or was not a compile-time constant: MyCustomClass on the fourth line of code. Any ideas?


Solution

  • Probably your source path is not setup in Flash Develop. In the project panel (View > Project Manager) select your source root directory (probably "src" since that is what Flash Builder creates by default) and right click and choose "Add Source Path". You can also setup your source paths in Project > Properties.. > Classpaths.