Definition mx.* could not be found

Aug 29, 2008

Tags: , , ,

Recently I ran across an issue that even stumped my teacher. For some reason when trying to use Flex's Fade class (mx.effects:Fade) on an ActionScript 3 project in Flex Builder 3. I would receive the error "Definition mx.effects:Fade could not be found." in Flex Builder's problem view. So the thinking cap went on, typically when you receive this error it's due to custom classes not being where you think they are. So I went into the projects properties and to the build path and added the path to flex sdk 3.1.0's framework source directory. Then did a clean build, this again failed now with tons of errors "Unable to resolve resource bundle "effects" for locale "en_US"" and many of the other core mx classes. So after more research (thanks to Google, not even the livedocs helped with this) I made the discovery of adding "--local=" to the compiler string. Take a peek how to fix this issue after the jump.

Fixing: Definition mx.* could not be found and Unable to resolve resource bundle "*" for locale "en_US"

First off to fix the "Definition mx.* could not be found" error you need to include the source folder for your flex sdk. Note this tutorial uses the Flex sdk 3.1.0 that comes included with the default install of Flex Builder 3 Eclipse Plug-in. On Windows this is typically located in "C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.1.0\frameworks\projects\framework\src". To include this folder open the Project menu and select properties, or right click on the project and choose properties. You will see a dialog similar to the one bellow, in the case of the selected project you need to select "ActionScript Build Path", for flex projects you need to select "Flex Build Path".

So as you can see there is an add folder button, simply click this and browse to or type in the path to Flex sdk's framework/src directory. Now when you compile you should see the errors bellow in Flex Builder 3's Problems view (the locale may vary). If your lucky you won't if not there's a hack to make this work as well.

To fix this one you again need to open the project's properties window, but this time go to "ActionScript Compiler" or "Flex Compiler" and add "--local=" to the additional compiler commands field. Do not put anything after the equals sign. As doing this will make the flex compiler think its a locale to look for, however you can put other commands after it.

Now that should resolve issues with not being able to find the mx classes as well as fix the locale issue. I have seen that you can comment out the locale section in the flex-config.xml however this did not seem to work in Flex Builder 3.0.1.

Posted in: Articles |