Google analytics code

Thursday, October 1, 2009

Flex: New Classes won't import into a project from a library

I ran into an issue while working on a Flex project where a new class I created in a Library wouldn't import, or auto-complete in the working project. It was also throwing a few different errors.

This was displayed at Runtime:
Variable xxx is not defined.

This was displayed in the Problems window:
Access of undefined property xxx.

Sometimes Flex doesn't update the Build Path to include new classes. If you run into this issue you can check to see if everything in your project is included in the Build Path.

Right-click on your Library project and goto Properties. Select "Flex Library Build Path" on the left and look in the Classes tab on the right. Scroll through the list to make sure everything is selected. If you're getting the errors above there is more than likely something in the list that isn't checked.

1 comment:

  1. Faster way: Right click on the Class and select "Include Class in Library".
    Unfortunately, there is no "Exclude from library" :(

    If you ever encounter some SVN/Compile problems (e.g. you deleted a class but the compiler tries to compile it), try to uncheck the package where this class was in (in the BuildPath dialogue on the screenshot), press ok, and check the package once again.


If you found this page useful, or you have any feedback, please leave a comment.