Building Flash Projects with Ant and Flex Builder – Part 3

February 16th, 2009

In Part 3 of this tutorial, we shall use a combination of the MXMLC compiler and JSFL script to compile an external SWF which will be loaded into your main SWF.

1. Download tutorial files

To begin this tutorial, please make sure you have set up your workspace as suggested in Part 1.

View Demo

Download Source Files

(more…)

Share/Save/Bookmark

Building Flash Projects with Ant and Flex Builder – Part 2

February 16th, 2009

In Part 2 of this tutorial, we’ll compile an ActionScript 3 only project simply by launching the MXMLC compiler with an Ant task in Flex Builder.

1. Download tutorial files

To begin this tutorial, please make sure you have set up your workspace as suggested in Part 1.

View Demo

Download Source Files

(more…)

Share/Save/Bookmark

Building Flash Projects with Ant and Flex Builder – Part 1

February 1st, 2009

As more Flash developers migrate towards using tools like Flex Builder and FDT for code editing, some of us have found that switching between the Flash IDE and Flex Builder doesn’t necessarily present the most seamless workflow. Compiling with the Flash IDE is slow and cumbersome; building an entire Flash project with code in Flex Builder doesn’t integrate nicely the designer’s workflow either. Until Flash Catalyst becomes available and magically cures all our designer-developer workflow headaches, what we need is a way to leverage each tool for what it does best, ie. the Flash IDE for drawing and layout, and Flex Builder for code.

Apache Ant is a software tool for automating software build processes implemented using the Java language. Ant uses XML to describe the build process and its dependencies, so no knowledge of Java is necessary for running Ant in your Flex Builder environment. By default the XML file is named build.xml.

In this series of tutorials, I will show you how to use Ant to create a workflow between the Flash IDE and Flex Builder. In Part 1 of this tutorial, we shall use Ant and JSFL to launch a FLA to publish a SWF.

(more…)

Share/Save/Bookmark

Stage RESIZE and the stageWidth and stageHeight Bug

September 22nd, 2008

A while ago, I came across a situation where my Flash application would launch but the stage.stageWidth and stage.stageHeight properties would always return 0 within my document class’s constructor. As I needed to access those properties at runtime and I did not want to hardcode those values to a pair of variables, it drove me to seek an answer to this problem.

Turns out that when the stage is initialized, its stageWidth and stageHeight properties are 0 until a Stage RESIZE event is triggered. This event is dispatched when the scaleMode property of the Stage object is set to StageScaleMode.NO_SCALE and the SWF file is resized ie. when the stage is rendered by the Flash Player. So if you need to add a display object onto the stage and its positioning is dependent on the stageWidth or stageHeight properties at runtime, it’s best handled by a listener that is subscribed to the Stage RESIZE event. (more…)

Share/Save/Bookmark

360|Flex Camp New Jersey

September 19th, 2008

I’ve signed up for 360|Flex Camp New Jersey, which will place at Montclair University, NJ, next Friday 9/26 and Saturday 9/27. This Flex Camp features one day of hands-on training and another packed with lectures by our favorite Flex luminaries. For more details, please visit http://www.360conferences.com/360flexcamp/.

If you would like to say “hi”, keep a look out for the person who resembles this avatar.

Share/Save/Bookmark