How to Create a Lib(.swc) File ?

The .swc file is the component compilation of the components.With this file included in the other projects of the lib folder [using Flex Builder IDE] we can use those compiled components.After include it in the lib foler of the project ,the components are added to the Custom folder in the Components view.
To do this we need to create a Library Project in Flex Builder, and create components there with our properties and functionality and the relating .swc file is created in the bin folder in that project which is the compilation of the components we define in the Library Project,we can define and create as many components in the Lib Project and the corresponding .swc file is updated i.e the compilation of the components are written in it.

So, when your are done with defining the components in Lib Project add the .swc file in the lib folder of the required Flex Project where you would like to use this custom components.

Now drag the CustomComponents from the Custom folder in the components view on the design view and the required functionality is written in them and we can add other funtionality.

This is with the Flex Builder, if not using the Builder then define the components in a folder and compile the components in that folder it will generate the .swc file.

For compilation use the command promt with the commands like

mxmlc filename.mxml

Happy Flexing..

17 Responses to How to Create a Lib(.swc) File ?

  1. Nargis says:

    This is very difficult to get stuff
    can u describe it in simpler manner?

    • kumargandhi says:

      Hi,
      If you are using the Flex Builder then do the following,
      Create a New->Flex Library Project, then in the project create a component like in the ordinary project , like i create a new Button Component and set the label to Kumar.Then the related Component compilation file(.swc) is generated in the bin folder of the library project.Now by using this .swc we can include those component in the Flex Project by adding it to the lib folder of the Flex Project.
      Now if you are not using the Flex Builder, then we got to set the path to the flex compiler in the sdk’s to the command prompt and compile our components from there.And it generates the Component compilation file(.swc) and rest is similar to that of the above.

      I hope now its clear, 🙂 ,

      regards,
      kumar.

  2. caxton says:

    Hi kumar:

    Do you know how to recompile SWC for flexlib(http://code.google.com/p/flexlib/)?

    I don’t know what compoment should be created after a new libary project has been generated.

    The main reason to recompile the swc is that I want to dispatch event to its schedule entry, but some methods are private so that I can not override.

    Thanks.

    • kumargandhi says:

      Hi,

      We need to have the component set to recompile, like here i need to have the flexlib component’s set code to recompile and generate a freash SWC for that set.Here SWC is itself a compiled file, so you cannot compile a compiled file.

      regards,
      kumar.

  3. Ragunth says:

    Hi,

    I want to remove some components from already existing swc. How to recreate the same swc with modified items. Please help me.

    Thanks in advance,
    ragu

  4. vishnu says:

    how to edit my swc file?

  5. vishnu says:

    Hai, thanks for your reply!!!!!!!!

    How can i bring a column chart on same page by clicking the existing column chart items???

  6. megha says:

    how to include swc file into a already existing project?

  7. kumar says:

    Hi,

    I need to create swc file of this three files. How could I do it ?

    yflexskin.in, yflexskin.css, yflexskin.swf

    thanks in advance.

    Akash

  8. Pradeep says:

    Hi,

    We are developing a project using flex carousel. I can rotate the carousel in 360 degrees. Now I want to add the reflection effect to it. I added the Reflection classes but only the front display is effected with the reflection where as If I rotate the circle the reflection effect is not moving along with the specified image.
    Its appreciable if you can help me out in this. Thanks in advance.

    Pradeep.

  9. Kunal Bhatia says:

    Hi Kumar,

    I’ve created a component in flex, a very simple VBox, I just want to use that in Flash CS5, with the procedure you specified can I export a SWC and then use it in Flash CS5.

    Kunal Bhatia
    ( :

  10. sri says:

    hi guys
    hope u doing great
    ihave 1 query how to integrate selenium ide with flexmonkium tool,i was done upto compilation but getting error is Description Resource Path Location Type
    unable to open ‘C:Program Files (x86)AdobeAdobe Flash Builder 4sdks4.5.1frameworkslocaleen_US-include-libraries’ GCS Provider Unknown Flex Problem
    plse any one tell what is the problem,
    how to preparing swf files.
    if u know this plse revert back emailid.
    thx guys,bye
    regards
    srikanth

  11. Vijay Tingrikar says:

    Hi kumar ,

    I have a .swc library project in which i have one .fla file which has lot of images in it . Now i want to add a new image to it . what i need to do ??. Do it need to create a new .fla file and then create a new .swc file ..Please let me know what to do ??

Leave a reply to Ragunth Cancel reply