Resolve Flex’s error: “Type was not found or was not a compile-time constant”

I just faced the terrible nightmare of “Type was not found or was not a compile-time constant” error (Flex Builder) and I lost several time to figure out what the problem was.
I realized that I was using the same name for MXML Application file which was already used by a class inside one of my packages. So, by renaming the file I solved the problem, but I was not completely satisfied and I looked for a way to avoid the error mantaining the same file/class name. Initially I tried to use namespaces, but as the reference says: “Applying a namespace means placing a definition into a namespace. Definitions that can be placed into namespaces include functions, variables, and constants (you cannot place a class into a custom namespace)”. I finally solved by renaming class references inside my package with the full qualified name (from MyClass to

Choose and install multiple Flex SDKs for Flex Builder

With Flex Builder is possible to install several SDKs (for example for testing purpose), all the SDKs are available here:
It’s possible for example to download the last SDK (still a preview) Flex 4 (codename Gumbo) and add it to the already installed SDKs, the procedure is really simple:

  • Download the zip file of the desired SDK (you have first to accept the license agreement)
  • Unzip it and rename the folder by leaving only the version number
  • Go to the installation folder of Flex Builder (which is in my case:  “/Applications/Adobe Flex Builder 3 Plug-in/”, because I’m using the Flex Builder plugin for Eclipse under Mac OS X)
  • Copy the zip content into the folder named “sdks”
  • Open Flex Builder and go to: Preferences / Flex / Installed Flex SDKs
  • Click on “Add…” button
  • Click on “Browse…” button and select the folder of the previously installed SDK
  • Flex Builder will automagically compiles the field “Flex SDK name” with “Flex 4.0” (the name can be changed to whatever we like)
  • Now is possible to choose which SDK will be used by selecting its checkbox (in this case checkboxes are not an adequate choice, they should be radio buttons, because we can use only an SDK at time)

This is how the SDKs window looks on a Mac:

Adding a new Flex SDK

Hello Flex, nice to meet you!

Today I’ve moved my first steps in the Flex world, following the introducing lessons of “Adobe Flex 3 – Training from the source”. After an introduction about RIAs, I’ve met Mr. Flex Builder and he told me about the fact that he has two faces, one for the source code and one for the visual design, and that he can switch among different perspectives (development, debugging and profiling)… then he showed me all his controls and layout components… he was so proud of them, but I told him that I can’t spend all the weekend to test their functionalities. So, I’ve took a look at how layouts work in Flex, and I’m very satisfied about the ability to draw dynamic areas that are able to resize and to be anchored to specific points.

Continue reading