Problem
Flex code, related to PixelBender, isn't compiling.
Symptoms
In Flex Builder / Flash Builder, I get the following errors:
- 1046: Type was not found or was not a compile-time constant: Shader.
- 1046: Type was not found or was not a compile-time constant: ShaderFilter.
- 1172: Definition flash.display:Shader could not be found.
- 1172: Definition flash.filters.ShaderFilter could not be found.
- 1180: Call to a possibly undefined method Shader.
- 1180: Call to a possibly undefined method ShaderFilter.
Solution
Clearly, these errors make no sense because both Shader and ShaderFilter are built-in classes distributed with Flash. Luckily, the solution is simple--you have to adjust your target Flash Player version. Make sure it's at least version 10:- Right click your project and choose properties
- Go to the Flex Compiler section
- At the bottom, in the HTML wrapper section, check the Require Flash Player version box (which requires the Generate HTML wrapper file box to be checked)
- Enter at least version 10.0.0
- Celebrate!