views:

59

answers:

4

How can I set up a project in Flash Builder for creating a collection of classes that is not an application by itself? When creating an Actionscript project it forces having a main application file, as well as sets up the whole bin-debug folder and such.

For instance, if you wanted to start coding something like Tweener, Papervision, or some other set of classes that doesn't publish to an application, how would you set up the project in Flash Builder?

A: 

I am using Flex 3, but i imagine it's the same in Flash Builder. If you right click in the Flex Navigator panel, go to New > Project, that will create an empty project. You can then set up your package structure and add classes as needed.

ezekielDFM
If I do this, it will not allow me to add a class to the blank project. When I do New > Actionscript Class, it will only allow me to create the new file in an existing Actionscript project.
Dustin
A: 

If I undestand you question correctly, then when you create an actionscript class you can't run/debug it only view it.

You should do the following: - right click on the project folder(the one with the flash logo on the folder) in your Package Explore window

  • click on Properties

  • click on ActionScript Applications (2nd from the top, in the left collom)

  • click on the Add... button (it's on the right)

  • then select your as file/s

  • Click on OK

  • Click OK again

And the you can run your ActionScript class :-)

Yobyn
Nope I want to create a library of classes that do NOT comprise an application.
Dustin
A: 

In File menu:

New - > FlexLibraryProject

Then New -> ActionScriptClass :)

Adrian Pirvulescu
Thanks, that seems to work great. The name is confusing...
Dustin
hehe... So you will build your library as a swc and you can include it inside other projects. Like dll's for c# or vc++ :D
Adrian Pirvulescu
A: 

The fact that FlashBuilder creates a whole project doesn't really matter. I usually create an Actionscript project and use the main class as an entry point to the set of classes I want to create.

In the project properties, I add a folder in my source path, and inside this folder I create the packages I want to work with

source directory //added to the source path 
    com/  // the set of classes i'm working on
      mydomain/
          mainpackage /

This way my classes are totally independent from my project.

PatrickS