Adobe’s ActionScript 3.0 Libraries

By Renaun Erickson

Contents

What are the ActionScript 3.0 Libraries?
How do I get the Libraries?
How to use the binary SWC in a project
How to use the source from Subversion

What are the ActionScript 3.0 Libraries?

The ActionScript 3.0 Libraries package was created by the Adobe Developer Relations team to help developers create Flex 2.0 applications. They provide a number of basic ActionScript 3.0 APIs for building mashup’s with Flickr, YouTube, Mappr, and Odeo, or other tasks like testing with FlexUnit. All the packages available can be found on labs.adobe.com, which provides documentation, source, and some articles.

It needs to be noted that Adobe considers these libraries as beta quality and are released under an as-is license with no support. The license can be found at:

http://labs.adobe.com/wiki/index.php/Source:license

How do I get the Libraries?

The ActionScript 3.0 Libraries are located on the labs.adobe.com site for download as well as in a Subversion repository. You have a choice to use the SWC binary format or checkout the Subversion project as source AS and MXML files.

You’ll find the Subversion repository filled with more than the ActionScript 3.0 Libraries, such as all the Flex examples found in the livedocs. You can browse the repository be clicking here.

Note: To people new to Subversion, you’ll find it common practice for each module in the repository to have three folders. These three folders are branches, tags, and trunk. You’ll find the latest source code in trunk as it’s the main branch of a module.

Note: Visit the url below to find out more information about source licenses and other nightly builds.

http://labs.adobe.com/wiki/index.php/Source:get

One of the benefits of using source files from the Subversion repository is that you’ll get all the FlexUnit test scripts and access to the inner parts of the code, which is one of the best ways to learn.

How to use the binary SWC in a project

To download the SWC, click on this link. We’ll start by downloading the corelib library as it is required by most of the other libraries. Click on the ZIP download link and save it to your normal download spot. Unzip the file and you’ll find three folders inside the corelib folder. These three folders being bin, docs, and src. The bin directory stores the binary SWC file. The docs of course contain documentations and the src folder is for the source code and test scripts.

Make note of where you extracted the files on your computer and jot down the path to the binary SWC file. Open up Flex Builder 2 and select File -> New -> Flex Project. Follow the wizard and create the Flex project you want. In the Navigator view click the Project node and select Project -> Properties. Then selected the “Flex Build Path” item on the left. On the right side select the “Library path” tab, then click on the “Add SWC…” button. You’ll provide or browse to the location of the binary SWC for corelib and select OK.

Note: You can also create a folder where you’ll put more than one binary SWC. Then you can use the “Add SWC Folder…” and add all SWCs at once to the project. This will not add all the SWC files to your compiled Flex application but will make them available for your use in the project.

How to use the source from Subversion

In order to use Subversion you must have a SVN client. Eclipse is a powerful IDE and has many plugins available, and of course there is one for Subversion.

To install the SVN client into Eclipse follow the instructions found at the following link:

http://subclipse.tigris.org/install.html

You’ll now have a SVN Repository Exploring perspective option. Change to this perspective, either Window -> Perspective -> Other or using the “Open Perspective” icon on the top right of eclipse.

To connect to a repository you’ll need to create a SVN repository location, do this by right clicking in the SVN Repository view. In the right click context menu select New -> Repository Location…, then copy the http://labs.adobe.com/subversion/flashplatform url into the url input field. You’ll find a new repository location in the SVN Repository location view. Explore down to the folder/module that you want to check out and right click on the folder and select either “Checkout…”. You’ll follow the checkout wizard which will give you the option of checking out into the workspace or using the New Project Wizard. For example select the “projects” and select the “Checkout…” context menu item. Select the “Check out as a project in the workspace” option, keep the default name and click the Finish button. Now switch the perspective back to Flex Development

You now can view all the source files in the “projects” project.