Error message
Error: Type was not found or was not a compile-time constant: YourNativeExtension
Cause
You would usually get this error message at compile-time, when your code references something in a library that the compiler doesn’t know where to find. In the case of using a native extension, this means that your project’s SWF file was built without the native extension (ANE).
Fix
Make sure the .ane file of the native extension is included in your project – see the examples below for ways to do it.
Examples
1. On the command line
Add the path to your native extension with the -external-library-path option when you run MXMLC to compile your project:
mxmlc +configname=YourProjectName
-output path/to/YourAppName.swf ProjectMainFile.mxml
-source-path+=path/to/src
-external-library-path+=path/to/your/native/extension
2. In Flash Builder
Select Project > Properties > Flex Build Path > Native Extensions > Add ANE… and add the native extension’s .ane file to your project: