Apparat

From FDT Documentation

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
-
[[File:Apparat_1.png|center]]
+
'''[[File:Apparat_1.png|center]]
With FDT 4.4 Beta, we've began to support [http://fdt.powerflasher.com/docs/File:Apparat_1.png Apparat]. Apparat is a powerful framework to optimize ABC, SWC and SWF files. It's open source and looks to push the boundaries of ways for Flash developers to enhance their workflows and applications.
With FDT 4.4 Beta, we've began to support [http://fdt.powerflasher.com/docs/File:Apparat_1.png Apparat]. Apparat is a powerful framework to optimize ABC, SWC and SWF files. It's open source and looks to push the boundaries of ways for Flash developers to enhance their workflows and applications.
-
 
-
Up till FDT 4.4 Beta, users who wanted to use Apparat had to create ANT scripts that would execute Apparat's commands.
 
=<center>Getting Started</center>=
=<center>Getting Started</center>=
Line 32: Line 30:
[[File:Scala_2.png|center]]
[[File:Scala_2.png|center]]
-
 
=<center>Setting Up FDT & Apparat</center>=
=<center>Setting Up FDT & Apparat</center>=
Line 40: Line 37:
Next thing, you'll need to tell FDT where to find Apparat and Scala.  This is done via 'Preferences > FDT > Apparat' preferences view. Simply choose the root directory of each.
Next thing, you'll need to tell FDT where to find Apparat and Scala.  This is done via 'Preferences > FDT > Apparat' preferences view. Simply choose the root directory of each.
 +
=<center>Adding Apparat To A Project</center>=
 +
When you want a project to enable Apparat, you'll have to enable it.  Once you do that, all existing and new launchers associated with that project will automatically have Apparat integrated into the build process.
 +
 +
[[File:Apparat_6.png|center]]
 +
To begin, right click on a project and select Properties.
 +
 +
[[File:Apparat_7.png|center]]
 +
Next, find Apparat within the project's Properties panel and click 'Enable Apparat for this project'. This will enable Apparat for the existing launchers and any new ones created.
 +
 +
==<center>Configuring Apparat</center>==
 +
[[File:Apparat_11.png|center|600px]]
 +
Adding and removing Apparat's features is simple, as can be seen in the above screen shot.  By default, FDT will pass in your compiled SWF to Apparat for processing. Since no specific output is defined, Apparat will overwrite the supplied SWF with the optimized one.
 +
 +
This GUI also enables you to add additional arguments. Learn more about Using Apparat's Arguments with FDT.
=<center>Using Reducer</center>=
=<center>Using Reducer</center>=
-
Apparat's reducer is handy for compressing PNGs and bytecode.
+
Apparat's reducer is a powerful feature that is used to compress PNGs and bytecode. From Apparat's [http://apparat.googlecode.com/hg/README README]:
 +
 
 +
''You can use reducer for advanced compression of your SWF files. Reducer tries to compress embedded PNG graphics. You can leverage this option also with the ActionScript compiler by specifing "[Embed(src=..., compress=true)]". However to speedup compilation you can ignore the compress parameter and let Reducer do the job since it makes use of multicore architectures.''
 +
 
 +
== Simple Reducer Example ==
 +
 
 +
[[File:Apparat_5.png|center]]
 +
If you're using the provided Apparat Example Project, running the 'No Apparat' launch configuration.
 +
 
 +
[[File:Apparat_8.png|center]]
 +
 
 +
FDT will then create a simple .SWF that is 740 bytes.
 +
 
 +
[[File:Apparat_9.png|center]]
 +
 
 +
Next, choose and run the 'Reducer Demo' configuration.
 +
 
 +
[[File:Apparat_10.png|center]]
 +
 
 +
FDT will then create the .SWF that is 740 bytes, then use Apparat's Reducer to shrink it down by 37% to 279 bytes.
 +
 
 +
== PNG Compression With Reducer ==
 +
[[File:Apparat_12.png|center|600px]]
 +
Opening up the Apparat panel within your project's Properties View, add an additional argument to Reducer 'q=.5'. This will adjust Apparat's JPEG compression level (see Apparat's [http://apparat.googlecode.com/hg/README README]).
 +
 
 +
*''Remember, we only need to pass the argument as 'q=.5' instead of the command line version '-q .5' ''
 +
 
 +
Back in Editor view, open the file ''PNGReducerDemo.as'' and notice that this is embedding an image.
 +
 
 +
[[File:Apparat_14.png|center]]

Revision as of 16:13, 18 April 2011

Apparat 1.png

With FDT 4.4 Beta, we've began to support Apparat. Apparat is a powerful framework to optimize ABC, SWC and SWF files. It's open source and looks to push the boundaries of ways for Flash developers to enhance their workflows and applications.

Contents

Getting Started

Before starting with Apparat, you'll need to download Apparat and Scala separately. This beta release of FDT 4.4 does not include Apparat or Scala.

Download Apparat

Apparat 2.png

Visit Apparat's Download Page for the latest version of Apparat or follow this download link After downloading them, expand the zip file and place them somewhere handy - you'll be linking to these sources shortly.

Apparat 3.png

Download Scala

Scala 1.png

Next just like when Apparat was downloaded, you'll need to download Scala as well. Scala is a general purpose programming language with some powerful features. Apparat is written using Scala so you'll need both.

Windows users can download it here.

OSX and Unix users can download it here.

After downloading the archive, expand it.

Scala 2.png

Setting Up FDT & Apparat

Apparat 4.png

Next thing, you'll need to tell FDT where to find Apparat and Scala. This is done via 'Preferences > FDT > Apparat' preferences view. Simply choose the root directory of each.

Adding Apparat To A Project

When you want a project to enable Apparat, you'll have to enable it. Once you do that, all existing and new launchers associated with that project will automatically have Apparat integrated into the build process.

Apparat 6.png

To begin, right click on a project and select Properties.

Apparat 7.png

Next, find Apparat within the project's Properties panel and click 'Enable Apparat for this project'. This will enable Apparat for the existing launchers and any new ones created.

Configuring Apparat

Apparat 11.png

Adding and removing Apparat's features is simple, as can be seen in the above screen shot. By default, FDT will pass in your compiled SWF to Apparat for processing. Since no specific output is defined, Apparat will overwrite the supplied SWF with the optimized one.

This GUI also enables you to add additional arguments. Learn more about Using Apparat's Arguments with FDT.

Using Reducer

Apparat's reducer is a powerful feature that is used to compress PNGs and bytecode. From Apparat's README:

You can use reducer for advanced compression of your SWF files. Reducer tries to compress embedded PNG graphics. You can leverage this option also with the ActionScript compiler by specifing "[Embed(src=..., compress=true)]". However to speedup compilation you can ignore the compress parameter and let Reducer do the job since it makes use of multicore architectures.

Simple Reducer Example

Apparat 5.png

If you're using the provided Apparat Example Project, running the 'No Apparat' launch configuration.

Apparat 8.png

FDT will then create a simple .SWF that is 740 bytes.

Apparat 9.png

Next, choose and run the 'Reducer Demo' configuration.

Apparat 10.png

FDT will then create the .SWF that is 740 bytes, then use Apparat's Reducer to shrink it down by 37% to 279 bytes.

PNG Compression With Reducer

Apparat 12.png

Opening up the Apparat panel within your project's Properties View, add an additional argument to Reducer 'q=.5'. This will adjust Apparat's JPEG compression level (see Apparat's README).

  • Remember, we only need to pass the argument as 'q=.5' instead of the command line version '-q .5'

Back in Editor view, open the file PNGReducerDemo.as and notice that this is embedding an image.

Apparat 14.png
Get FDT5