PDA

View Full Version : importing custom library classes


actionM
01-24-2010, 03:06 PM
Hello, I'm using Flex SDK and I'd like to be able to have a directory anywhere on my hard drive that contains a library of reusable classes that I made. And I'm just wandering how I can import those classes into my game i'm trying to make without copying and pasting them directly into my game folder? I tried symbolic links with no luck.

Barna Biro
01-24-2010, 03:12 PM
Build a SWC and import that into your project. Having folders spread out on N partitions / drives is just not cool. If a project uses certain libraries, then those libraries should be inside the project folder.

actionM
01-24-2010, 03:51 PM
Well the plan wasn't to get too crazy with the location of the Library. I just wanted it separate but accessible from the different games I will be making. Maybe a structure like this:

flash
----library
--------Movement.as
--------Bounce.as
----games
--------tetris
--------arkanoid
--------pacman

So your saying something like that would be bad? Sorry about all the newb questions, but i've always just put everything in the game folder and I'm just now wandering if theres a better way.

Barna Biro
01-24-2010, 04:08 PM
Create a Flex Library project that will in essence contain your library and compile a SWC file. Whenever you want to use the library, you just impot the SWC and that's it ( or link the library project to the actual game project... I'd personally go with the SWC ).

actionM
01-24-2010, 04:48 PM
Thanks alot.

bowljoman
01-24-2010, 05:08 PM
Just add the desired directory tree as an additional source file.

That would be better.