Flex and source folders for packages

18 01 2008

Here’s an interesting ditty with Flex. If you are using namespaces – which you will of course – you must put the src files in folders named aptly. For example:

package com.justinjmoses.custom
class MyClass {}

This needs to be stored in /src/com/justinjmoses/custom/MyClass.as

Note: the “src” folder is required in Flex 3, not in Flex 2.

Otherwise you’ll get errors along the lines of

1046: Type was not found or was not a compile-time constant: MyClass.




One response

18 01 2008

You can change this behavior, if you wish, by setting the “Main Source Folder” in the Flex Builder Path settings (you can find this by right clicking on your project, and selecting Properties). You can make Flex2 or Flex3 behave or not behave like this by changing this setting.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: