Search code examples
javaapache-flexswc

how to use swc file in flash builder project


HI.. i have a swc file i have added file to my project using http://interactivesection.files.wordpress.com/2008/11/use_flash_code_library_in_flex.jpg how can i use this component in my flash builder project. thanks


Solution

  • After adding the swc to the project as shown in your screengrab, you can just use any of the classes in the swc as you would any other class in your project:

    AS:

    import some.package.in.my.swc.SomeClass;
    
    private var someClass:SomeClass;
    

    MXML:

    Add a namespace to the top level tag that points to a package in the swc, such as xmlns:library="some.package.in.my.swc.*", then add tags like so:

    <library:SomeComponent/>
    

    Hope that helps.