how to use swc file in flash builder project

4.6k views Asked by At

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

2

There are 2 answers

1
Wade Mueller On BEST ANSWER

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.

0
Timmo On

Project Properties | Flex Build Path | Add SWC

and then to use a component import it in your ActionScript class