views:

154

answers:

1

Why does FlexBuilder insist on a main class in the root of the source folder?

By insist I mean that if I create an Actionscript project called MainTest. A file called MainTest.as will be placed in the root of the src folder.

if I now create a package/folder called some/package and place the MainTest.as in it (and adjust the package statement accordingly), I cannot select the project to use this as the application class in Properties/Actionscript Applications as the package is empty as far as Flexbulider is concerned.

So there is a restriction that a main/application class cannot have a package other than the root package. The mxmlc compiler and FDT do not enforce this restriction so why does Flex Builder?

A: 

Hi Brian, I am not sure if I am getting the problem statement correctly. Still, if I am correct you are unable to set an application as your main application once you place it outside src folder.

In this case why don't you change the 'Flex Build Path' in 'ProjectProperties>>FlexBuildPath>>Main Source Folder' accordingly.

Once this done you may also be required to set your 'MainTest.as' as default application in 'ProjectProperites>>Flex Applications>>set as deafult'.

Hope, it helps.

Ashine
Hey Ashine, thanks for the reply. This is not my problem, I've clarified the restriction. in the question. The problem is that the mxmlc compiler allows you to have a main class with a package 'com.somecompany.someapp', but FlexBuilder imposes a restriction that a main class must exist in the root package. I'm wondering why this is so.
Brian Heylin