Giving Flex Builder a Library (SWC)

Have you ever wondered why Flex doesn't have a nice library like Flash IDE?
You'd love to use Flex but not having that nice little library there puts you off?
Well here's how we do it:
First create your FLA file, then create all the items you want inside (they don't need to be on stage just library will do), be sure to tick 'export for actionscript' and 'export in firstframe', also you can change the base class to something else that will add functionality to your movieclip.
Then in export preferences, tick 'export swc'.
Ok so now we have a nice little SWC file, how do we get it into Flex? Easy :)
Open project properties, go to Build Path > Library Path and add your SWC file.
That's it!
Congratulations now you have auto complete goodness on your AS3 Flex Builder application :)
Just keep in mind that these elements will be exported in the initial load of your website, so if you want to preload them be sure to use the preloader.

3 Responses to “Giving Flex Builder a Library (SWC)”

  1. Frazko Says:

    Can i do this for Flash Develop???

  2. Idoru Says:

    Hi Frazko, I have no idea as I’ve never used flashdevelop, but i can check it out as soon as a I find a little time

  3. Idoru Says:

    Ok you can have the libraries but flashdevelop won’t give you auto-complete goodiness :)
    Just add this line to the compile line -include-libraries PATH_TO_SWC
    hope this helps

Leave a Reply