Be a Supporter!

Libraries in FlashDevelop

  • 480 Views
  • 10 Replies
New Topic Respond to this Topic
GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Libraries in FlashDevelop Mar. 2nd, 2013 @ 10:28 PM Reply

I've been using FlashBuilder for the past 3 years and I've recently switched to FlashDevelop. I like it but the project outline seems pretty different. In FB I could see the outline of all my projects, but I only know how to view one project in FD. that's fine, but I'm working on an engine that I want to use in several projects and I would like to know how to create a library that I can import into various projects.

milchreis
milchreis
  • Member since: Jan. 11, 2008
  • Offline.
Forum Stats
Member
Level 26
Programmer
Response to Libraries in FlashDevelop Mar. 2nd, 2013 @ 11:24 PM Reply

At 3/2/13 10:28 PM, ImpotentBoy2 wrote: I would like to know how to create a library that I can import into various projects.

You write the classes of your library and then use those classes in your projects.

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to Libraries in FlashDevelop Mar. 2nd, 2013 @ 11:35 PM Reply

At 3/2/13 10:28 PM, ImpotentBoy2 wrote: I've been using FlashBuilder for the past 3 years and I've recently switched to FlashDevelop. I like it but the project outline seems pretty different. In FB I could see the outline of all my projects, but I only know how to view one project in FD. that's fine, but I'm working on an engine that I want to use in several projects and I would like to know how to create a library that I can import into various projects.

Project > Properties > Classpaths > Add Classpath > folder with library inside. You have to add any swcs to the library, but the as files are all readily available.

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to Libraries in FlashDevelop Mar. 2nd, 2013 @ 11:45 PM Reply

At 3/2/13 11:35 PM, MSGhero wrote:
At 3/2/13 10:28 PM, ImpotentBoy2 wrote: I've been using FlashBuilder for the past 3 years and I've recently switched to FlashDevelop. I like it but the project outline seems pretty different. In FB I could see the outline of all my projects, but I only know how to view one project in FD. that's fine, but I'm working on an engine that I want to use in several projects and I would like to know how to create a library that I can import into various projects.
Project > Properties > Classpaths > Add Classpath > folder with library inside. You have to add any swcs to the library, but the as files are all readily available.

Sweet! Can the imported library can be an .as3proj, and not just a swc? does it matter if the imported project has a document class?
will I be able to edit imported projects and have those changes effect all projects that use that project?

milchreis
milchreis
  • Member since: Jan. 11, 2008
  • Offline.
Forum Stats
Member
Level 26
Programmer
Response to Libraries in FlashDevelop Mar. 3rd, 2013 @ 07:46 AM Reply

At 3/2/13 11:45 PM, ImpotentBoy2 wrote: Sweet! Can the imported library can be an .as3proj, and not just a swc?

as3proj is a file of FD for organization purposes, the compiler does not know how to handle these.

To group files of a library, use packages.

does it matter if the imported project has a document class?

Why would that matter?

Again, you just use some classes, it doesn't matter if in some other project, one of them is a main class.

will I be able to edit imported projects and have those changes effect all projects that use that project?

You can always simply open a class file and edit it.

Obviously other projects have to be recompiled to include the changes.

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to Libraries in FlashDevelop Mar. 3rd, 2013 @ 08:58 AM Reply

At 3/3/13 07:46 AM, milchreis wrote:
At 3/2/13 11:45 PM, ImpotentBoy2 wrote: Sweet! Can the imported library can be an .as3proj, and not just a swc?
as3proj is a file of FD for organization purposes, the compiler does not know how to handle these.

To group files of a library, use packages.

Ok I looked into the classpath thing, I guess i just specify the folders. and yeah I'm a fan of packages.


does it matter if the imported project has a document class?
Why would that matter?
Again, you just use some classes, it doesn't matter if in some other project, one of them is a main class.

the same way having 2 document classes in a single project would matter, I guess I can just specify which one to use.

will I be able to edit imported projects and have those changes effect all projects that use that project?
You can always simply open a class file and edit it.

I'm wondering I can edit my imported projects without switching projects. In FB all the projects are open at once, even if they don't reference each other.

Obviously other projects have to be recompiled to include the changes.

right.

milchreis
milchreis
  • Member since: Jan. 11, 2008
  • Offline.
Forum Stats
Member
Level 26
Programmer
Response to Libraries in FlashDevelop Mar. 3rd, 2013 @ 09:47 AM Reply

At 3/3/13 08:58 AM, ImpotentBoy2 wrote:
does it matter if the imported project has a document class?
Why would that matter?
Again, you just use some classes, it doesn't matter if in some other project, one of them is a main class.
the same way having 2 document classes in a single project would matter, I guess I can just specify which one to use.

There's only one document class per project.

will I be able to edit imported projects and have those changes effect all projects that use that project?
You can always simply open a class file and edit it.
I'm wondering I can edit my imported projects without switching projects.

As I said, you can edit any file.

You seem to be keen on having multiple projects open.
You always have the option to open multiple instances of FD.

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to Libraries in FlashDevelop Mar. 3rd, 2013 @ 10:03 AM Reply

At 3/3/13 09:47 AM, milchreis wrote: As I said, you can edit any file.

You seem to be keen on having multiple projects open.
You always have the option to open multiple instances of FD.

Yeah I guess theres that, thanks

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to Libraries in FlashDevelop Mar. 4th, 2013 @ 08:50 AM Reply

Just thought I'd followup after trying it out. not only am I unable to open multiple instances of FD, but apparently I don't have to. importing projects via classpaths opens the project, and I can edit it there, and everything is awesome. I don't hate flashdevelop anymore.

coolbeans.

Libraries in FlashDevelop

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to Libraries in FlashDevelop Mar. 4th, 2013 @ 10:31 AM Reply

create a folder called "res" for "resource"

you also have "lib" for "library" - I hope you're aware.


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to Libraries in FlashDevelop Mar. 4th, 2013 @ 10:45 AM Reply

At 3/4/13 10:31 AM, egg82 wrote: you also have "lib" for "library" - I hope you're aware.

That confused me, I don't want to actually move my libraries there when I can just reference their location. what is lib generally used for in FD?