I would say that the majority of Flash Platform developers have now used source control.

As a developer are you testing locally, committing to source control and finally manually deploying your SWF’s to staging and production environments?

Do you work on applications as part of a team?

Do you use Continuous Integration (CI) and automated builds?

My answer was yes to all of the above except unfortunately the CI process. As you may well know from my blog and on twitter I have a keen interest with Project Sprouts and recently have also looked at Buildr, particulary Dominic Graefen’s AS3 port: Buildr-as3.

Together with Dominic (share my pain) Graefen (thnx man), I have been determined to setup a CI server using Jenkins on an Amazon EC2 instance which compiles SWFs and runs FlexUnit tests, for example on commit to git.

This was not a straight forward task…in fact it was a Grade A pain in the ar$e but eventually (it would appear) I managed to refine the process down to achieve the goal. Below are the steps that I have taken to set up an EC2 micro-instance with Git, Jenkins, RVM, Ruby, VNC, standalone debugger Flash Player, Buildr-as3 and compile/run FlexUnit tests using a Flex 4 based example! I have setup and torn down at least 6 instances to test and remove surplus instructions so hopefully it’s as lean as possible.

I am sure there could be further refinements made and on one of my test server setups I found I had some odd output which I need to work out why and where?

*(gflashplayer:1490): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)’

(gflashplayer:1490): GLib-GObject-CRITICAL *: g_signal_handlers_disconnect_matched: assertion `G_TYPE_CHECK_INSTANCE (instance)’ failed

But the tests run and all is happy. Micro-instances and rvm/project builds are not fast and I found have a tendency to hang on the first run/install so perseverance is required, but once running, all seems sweet with the world. Any further tips or guidance would be most welcomed! Oh and if you want to see an example of using CI for your Flex/Flash project just take a peek at this super sweet example.

Read on →

This blogpost is simply to promote that there is a fantastic utility named RobotEyes out there for end to end testing your AS3/Flex applications and provide a simple example to help get you started in the right direction. I am currently writing a more in depth article on end to end testing AS3/Flex applications and therefore want to keep this post brief and to the point.

Are you a Flex or AS3 developer?

Do you use TDD?

If yes for both then do you do end to end testing?

For me the answer was no, that is until Stray first walked me through the concept whilst also introducing me to her utility named RobotEyes to facilitate end to end testing. I then proceeded to fork her RobotEyes repos and integrated the necessary logic to utilise the tool within a Flex project (see my RobotEyes Flex fork). There are other end to end tools for Flex out there but the major advantage for using RobotEyes as opposed to the other options are that RobotEyes actually integrates into your existing test cases, oh yeh!!!

AllTests.as
1
2
3
4
5
6
7
8
9
10
11
12
import com.newtriks.views.LoggerTest;
import com.newtriks.views.SearchViewTest;
import com.newtriks.xendtoendtests.SearchWithResponseTest;

[Suite]
public class AllTests
{
    // End to end in the test suite yo!
    public var search_with_response_test:SearchWithResponseTest;
    public var search_view_test:SearchViewTest;
    public var logger_test:LoggerTest;
}

I have now constructed an example Flex 4 project to demonstrate an end to end test using RobotEyes. To help grasp the concept I have tried to keep this example as simple as I possibly can. The particular example introduces ASUnit 4 so you may want to also have a look at my previous blog post as an introduction into ASUnit 4. Please watch this space for further information on both RobotEyes and end to end testing AS3 and Flex applications.

RobotEyes Flex example

I have been avidly attempting to learn Ruby and to begin with, found writing out simple code comparisons for each language helped me visualise how Ruby came together better. I thought these may prove useful to some other AS3 devs looking to have a play around with Ruby so am sharing them in this blog post. I will aim to update them over time and welcome input and suggestions. There are many resources out there for learning Ruby but for a quick overview I found Lukes post and Ruby in 20 minutes were great!

Read on →

Last week I was setting up an example project for RobotEyes and was using ASUnit4 which has had some tasty improvements made since version 3.  ASUnit is a collaborative effort between @lukebayes and @robpenner and has been my choice of unit testing framework for a while now.  In this blog post I will show you how to get ASUnit4 setup in IntelliJ IDEA and run a few tests taking advantage of some of the features for this new release. Read on →

Recently I tweeted a Screencast of an example creating AS3 projects/classes using ProjectSprouts and Rake via AlfredApp.  I had a couple of requests to share my scripts and so I created a new github repos called Shell-Funk.  I must give a clear heads-up here that I am in no way a shell script or apple script ninja and these scripts work but I cannot guarantee how great they are and would welcome input on improving them.  They are also Mac OS X dependent.

Simply put Alfred App is:

Alfred is a productivity application for Mac OS X, which aims to save you time in searching your local computer and the web. And Project Sprouts is: Project Sprouts is a highly cohesive, loosely coupled collection of features that take some of the suck out of programming. So the two combined essentially mean super speed and efficiency for those mundane tasks i.e. creating new projects or classes etc.  The first script I put up creates a new AS3 project, downloads Stray’s Project Sprouts generators for Robotlegs and opens up the newly created project in a Finder window.  Have a play and see what you think and also be sure to check out this amazing site for further scripts to use with Alfred.

A while back I setup a new Amazon EC2 micro-instance using Amazon’s own Linux AMI (based on Centos). On firing up the instance I attempted to run a simple scp command which ultimately failed. The reason I wanted to use the scp command was to push and append to authorized_keys my own generated SSH key to my instance, this is a personal preference over the generated Key Pair (.pem) Amazon recommends you use.

As you may be aware, this particular setup also discourages (and as I recall prevents) a root password login, naturally for heightened security, so I had to do some digging. I soon discovered that using the cat command I could work around the issue and append my local public ssh key to the authorized_keys on the remote server. This is what it should look like:

Read on →

Here’s a small post offering a solution to an issue I had recently. My goal was to run a shell script using cfexecute, one of the arguments being an Array itself. If your passing arguments in this manner on Linux (my flavour) elements are copied into an array of exec() arguments and I kept getting an error back from ColdFusion stating I was trying to pass off a complex object as a simple one (or something along those lines - makes sense). So the key was trying to fathom out how to pass my array of Strings to this Shell script, after a bit of trial and error I got it working by doing the following: Read on →

I recently got asked about how I store and retrieve data within a Spark DataGroup using a custom ItemRenderer, with a particular focus on how to monitor property changes. There are a few ways to achieve this, particularly when it comes to storing and retrieving data, here is one simple example using a CheckBox within a custom ItemRenderer and observing the total selected CheckBoxes.

Here I will detail the main snippets of functionality, download the actual source (links at bottom of the post) to get the full picture.

Read on →