0

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?

BefittingTheorem
  • 10,459
  • 15
  • 69
  • 96
  • added a fuller description of the problem – BefittingTheorem Mar 03 '10 at 08:53
  • Are you trying to create the package outside of the source (src) path? I have no problem doing what you describe as long as I stay within the source folder path. – Stiggler Mar 04 '10 at 00:59
  • I'm using FB Eclipse plugin v3. In a simple ActionScript project the application class will be not show in the Applications panel (I can browse the package folders) if I move it into a package within the source path. – BefittingTheorem Mar 04 '10 at 08:57
  • Eclipse build is 3.3.2. I have a standalone Flex Builder at home, I can try there later on. – BefittingTheorem Mar 04 '10 at 08:58

1 Answers1

0

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
  • 4,517
  • 3
  • 24
  • 26
  • 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. – BefittingTheorem Mar 03 '10 at 13:03