SDK Management

From FDT Documentation

(Difference between revisions)
Jump to: navigation, search
(Edit A Project's SDK (Add or Remove Source))
(Edit A Project's SDK (Add or Remove Source))
Line 78: Line 78:
textFlow.flowComposer.addController(new ContainerController(this, 400, 200));
                    new ContainerController(this, 400, 200));

Revision as of 19:41, 29 September 2010

Right now is an exciting time for Flash development. Soon there will be mobile AIR development, mobile Flex development and new Flash/Flex features continuously being added. This makes SDK management particularly important.

This tutorial will go over the basics of managing SDKs with FDT.


Getting Started

All you need to follow along is a project open. You can either create your own or import the project created at the end of the Basic AS3 Tutorial. Visit the Downloads page to get it.


FDT is an IDE specializing in creating applications for the desktop and web - whether you're using the Flex framework, ActionScript only or even haXe. But in order to do this, it needs to know what tools to use to get you where you want. That is where SDKs come in.

Think of your finial application as a piece of hand crafted furniture. In this scenario, you're the master craftsman and FDT is your assistant. What is missing here are your tools, and it's the job of your assistant (FDT) to make sure your tools are ready for you to use. The type of tools you and FDT use determine what kind of furniture (your finial application) you create. This is where SDKs come in. Explaining how and what exactly SDKs are is too big of a topic to get into here, but for a quick intro check out Wikipedia's article about SDKs.

FDT uses the Open Source Flex SDK to build Flash applications. The initial release of FDT 4 shipped with two SDKs - Flex 3.5 and Flex 4.0; however, you're likely going to want to add more SDKs as newer Flex SDK become available as well as add more specific SDKs (e.g. for mobile development) or even create and use custom SDKs.

FDT's Shipped SDKs

A good place to start is where FDT keeps the SDKs it ships with. If you look inside the plugins folder of your FDT installation directory, you'll see two folders that being with:


In this example, we see that FDT has shipped with Flex 3.5 and Flex 4 [1]. Taking a closer look, we can see the SDK .ZIP file that FDT unzipped when it first installed. in this example, and the flex directory where it unzipped to [2]. Knowing where these default SDKs are is useful if you ever have a problem with them.

Adding and Removing SDKs

Adding and removing SDKs is very simple. Begin by going to FDT's Installed SDKs window located here [3] at:

Preferences>FDT>Installed SDKs

Here we can see your installed SDKs and their location. In this example , we see the two SDKs pointed our earlier in this lesson that are inside of the plugins folder within FDT's installation directory [4].

The checkbox next to the SDK entry is what FDT will use by default when you create a project. You must always have a SDK selected and your can't remove a SDK when it's been selected as the default.


The quickest way to add a SDK is to click the Search button within the Installed SDKs window [5]. A window will then open and ask you to Select the root directory of the SDK [6]. In this example, several SDKs have already been downloaded and uncompressed and are all within one sdks folder. The specific location of your SDKs is not terribly important, but it helps to keep them together.

After selecting the root directory of the SDK you want to link to, select Open [7]. FDT will then scan the SDK for all the source code (distributed as .SWCs) that are included with the SDK [8]. When complete, FDT will detect the name of the SDK, Flex Hero in this example,and add it to your list of Installed SDKs for you to edit, delete, duplicate or remove [9].

Remove SDK

If you decide that a SDK is no longer needed, removing is just one click. With the target SDK selected, but not set as your default SDK, click the Remove button [10]. FDT will then remove the SDK from your list.

*note: This doesn't delete your folder containing the SDK. It will still remain on your hardrive.

Using SDKs With Your Project

With your SDK locations installed into FDT, you can now begin to use them with your projects.

Change A Project's SDK

A time may come when working on a project where you may want to change the SDK that is being used. Changing an existing project's SDK is simple. With your project open in the Flash Explorer, right click on the project and navigate to Flash Project>Change SDK [11]. The Change SDK window will appear and you can then select an existing SDK [12] or click on configure... [13] in case you want to add a new one [14].

Edit A Project's SDK (Add or Remove Source)

Another adjustment that can be made to a project's SDK, is to omit or add .SWCs that are already existing with the SDK.

For example, while using FDT's default AS 3 project type, you may want to use the new Text Layout Framework.

FDT's project types allow for a lean implementation of the Flex SDK - this helps keep things organized and minimize version and compilation errors while projects evolve. Because of this, some of FDT's default project types exclude certain parts of the Flex SDK from the build path. The SDK is still intact, but in order to add the SDK's Text Layout Framework to our AS 3 project type, we'll need to add it.

*note: Any of FDT's Flex project types will automatically include the Text Layout Framework - it's just the lean AS 3 project type that omits it.

To begin, let's create a new Class that uses the Text Layout Framework. Create a new class, and copy the source code below.

package {
	import flashx.textLayout.container.ContainerController;
	import flashx.textLayout.elements.ParagraphElement;
	import flashx.textLayout.elements.SpanElement;
	import flashx.textLayout.elements.TextFlow;
	import flash.display.Sprite;
	 * @author Powerflasher
	public class TextLayout extends Sprite {
		public function TextLayout() {
                var textFlow : TextFlow = new TextFlow();
		var p : ParagraphElement = new ParagraphElement();
		var span : SpanElement = new SpanElement();
		span.text = "Hello, World";
		span.fontSize = 48;
                    new ContainerController(this, 400, 200));

As you'll notice, FDT lights up like a pinball machine [15]! This is because FDT isn't including the textLayout.swc in the build path. If you were using a Flex project, it would, but since this is a lean AS 3 project, it's been left out. This can be confirmed by expanding the SDK library within the Flash Explorer [16].

Begin adding the textLayout.swc by right clicking on the project, and choosing Properties [17]. When the Properties window opens, choose the SDK Library tab [18]. Once here, click on the Select SWCs... button [19].

What will appear is the Included SWCs window. Here you can add or take away chunks of source code from the SDK your project is associated with. To add the Text Layout Framework, click on the textLayout.swc checkbox and then hit OK [20]. FDT will then add the .SWC to your build path [21].

When you return to your editor, you'll see that FDT now had included the textLayout.swc with your build path and all the errors have disappeared [22].

Get FDT5