Monthly Archives: March 2010

Using Flash Components in Flex Builder

I ran into this again today and had to think it out, so figured it might help some folks.

If you are looking for the fl.controls.ComboBox or other fl.controls code in Flash Builder, you will find it conveniently absent.  The easiest way I have found to make available the code for the controls I want to use in a Flash project built in Flex Builder is to create a Components.fla file and then compile it out to a .swc.  You can then include the

1. Create an empty flash file called Components.fla

2. In the publish settings of your flash file, click the Flash tab, then check the Export SWC box.

3. Drag the components you want to use in your project to the stage (don’t worry, you can come back later and add more if you need to).

4. Save your file, then File>Publish.

5. In Flex Builder, right click on your project folder and go to Properties.

6. Click Actionscript Build Path on the left column, then the Library Path tab.

7. On the library path tab, click Add SWC and browse to the SWC file you just created.

Poof, now you have Flash Component code available in your Flex environment for code hinting, etc.