简体   繁体   中英

Can I change the 'Default Application' class of AS3 projects in Flex Builder 3?

When creating an Actionscript Project in Flex builder 3 an application class is automatically created and dropped in the root of your source folder. In my case my source folder is called src/ .

Is it possible to change the default application class to a class which is not directly in the root of the src folder? It seems when right-clicking on class files which are in sub packages the 'Set as Default Application' option is not selectable.

Is this done on purpose by Adobe to enforce all pure AS projects to have their application class residing in the top-most package?

You're going to have to make changes to the compiler's "source" directories. Doing this has worked for me in the past...

I'm assuming you're using a structure like this

> MyApp
  > html-template
  > main
    > MyApp.as
  > src

Where main is going to be the location of your default application?

  1. If you do this, right click on your top-level (in my example -- MyApp) or go to the FlexBuilder Menu and click on File and then Properties menu item.
  2. Go to the ActionScript Build Path property

    a. Change your main source folder to 'main'

    b. Then, click on the Add Folder...

    c. Add src, then click Ok

  3. Go to ActionScript Application -- here your runnable applications, and since you changed your main source folder, you might not see anything there.

    a. Add a link to your main/MyApp.as file

That should do it.

There is application settings file ".actionScriptProperties" in top directory of the flex project. So you can change path to main .mxml file in it to whatever you want.

Don't know if this helps but looking at http://bugs.adobe.com/jira/browse/FB-14144 and reading the comments it seems like Flex Builder 3 won't do this on some systems. They seem to have fixed it in Flash Builder though. It's the little things that annoy the most.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM