Adobe Air Adobe Flash CS4 Flex Flash Builder Flash Catalyst

Contact me at : hello[at]gauravjassal[dot]com

Webdevelopment Blog



Distributing a component as a SWC
January 28,2009 at 4:12 pm | Actionscript 3, Flash CS4, Flex 3 | No Coments

When you develop a actionsction 3 component its good to compile the component to .swc file and reuse it in different projects. To create a SWC file, use the compc compiler in the flex_install_dir/bin directory. The compc compiler generates a SWC file from MXML component source files and/or ActionScript component source files.
In this example, you create a SWC file for a custom formatter component that you defined by using the following package and class definition:

package com.gauravjassal.controls.TwitterList
{
//Import base Twitter class.
import mx.controls.Label

public class TwitterList extends UIComponent{
...
}
}

You use the following compc command from the flex_install_dir/bin directory or flex_builder_director/sdks/sdkversion/bin to create the SWC file for this component:

.\compc -source-path c:\flex\wamp\www\Twitter\src\
-include-classes com.gauravjassal.controls.TwitterList
-o c:\flex\wamp\www\Twitter\TwitterList.swc

Leave a Reply

Recent Blog Entry

This extension notifies you with latest London underground tube updates. You can click on the browser button and check the status of any tube line.By default the extension updates the status in every 5 mins.


Read More

In the second example I am going to use Standard PHP Library (SPL) to notify all attendees about the party location change. SPL has 2 interfaces and a Class for Observer.


Read More

The Observer pattern defines a mechanism by which components can opt-in to receive messages when a target object changes its state. Its works similar to Listening to a Change event for a object or Trigger in a database


Read More

Featured Projects

My Blog

© 2008 Gaurav Jassal