- Open Flex builder 3
- Navigate to File->New->Flex Library Project
- In the New Flex Library Project dialog
- Enter the project name as "FirstLibProject"
- Click on Next
- Select the Classes tab
- In the Main source folder item click on Browse
- In select Source folder dialog select the project
- Click on New button
- A new folder will be added under the projects
- Click Ok
- Select the checkbox for the src folder (All the classes in this folder will be included in library swc)
- Click on Finish button
- Create an mxml component under src folder by right clicking on src folder and name it "LibrarySample.mxml"
- Create an Action script class under src and name it as "LibraryAS.as"
- In the bin folder a swc file will be created by name FirstLibProject.swc
In our mxml if we want to use these Files which we created above we can include the swc file to our project.
Including the swc file in a project:
In the project "Xyz" which we want to include the swc copy the swc which we created above:
- Copy the FirstLibProject.swc to some path (c:\lib)
- Open the project "Xyz" in Flex builder
- Right click on the project "Xyz" (in navigator view) click on Properties
- Select Flex Build Path in the Properties dialog
- Select Library path tab
- Click on Add SWC and browse for C:\temp\FirstLibProject.swc and click Ok
- In this project we can use the classes LibrarySample and LibraryAS