“Be inspired, enjoy your work, keep learning and never forget to play.” — gskinner

Giving Flex Builder a Library (SWC)

Posted: February 27th, 2008 | Author: Idoru | Filed under: Actionscript3, Adobe Flex, Tutorial | 3 Comments »

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.