Archive for the ‘AS3’ Category

An internal build error has occurred. See the error log for more information.

Tuesday, January 24th, 2012

ONE of the reasons this might happen is because of the following:

public static function compareStrings ( firstString:String, secondString:String ):String
{
	firstString:String = tidySpace( firstString );
	...
}

You see that firstString:String = etc there? That’s the fella. DON’T EVER strongly type your vars more than once, unless you wanna lose an hour of dev like I have this morning.

AIR Apps Need Planning

Thursday, August 12th, 2010

[click the image to see a larger version]

This diagram outlines an XML load procedure. Complicated, no? That’s because it’s for an AIR app, and therefore has to cope with situations other Flash & Flex apps don’t. I’m showing it to make the case for planning AIR apps in advance as much as possible.

(more…)

Flex Carousel Component

Saturday, January 16th, 2010

I recently made this Carousel component for Flex

(more…)

RobotSignals: Combining RobotLegs with Robert Penner’s Signals

Sunday, December 20th, 2009

Robotlegs is an AS3 dependency injection micro-framework.

Signals is a new approach for AS3 events, inspired by C# events and signals/slots in Qt.

Put them together and you’ve got an elegant, simple & completely decoupled solution to the problem of Flex & AIR development.

I’ve thrown together a really quick example (which you can download below) based upon a couple of things I’ve seen recently; firstly Richard Lord’s framework comparison talk at FlashBrighton a couple of weeks ago, and secondly, Owen Bennett’s  blend of RobotLegs and Signals he showed me last week. Seeing what Owen had put together inspired me to have a go myself. I wondered whether it was possible to create a RobotLegs/Signals hybrid that was even more decoupled than the system Owen was working on. So I created a short (less then 100 lines) class called ‘SignalBox’, named after a similarly named class in Owen’s system.

(more…)

HowTo: Improve your workflow with Snippets, comments and ‘dormant’ variables

Sunday, January 25th, 2009

I use FlexBuilder. I used to use FDT but the code-completion, hover-over links and - most importantly - ability to compile from MXML that FlexBuilder offers eventually tempted me away. Still, there’s one thing about FDT I miss: it wrote A LOT of code for me. Nothing complicated, stuff like getters & setters that are tedious and time consuming. It was great that FDT could take that off my hands.

These days, with FlexBuilder, I don’t have that any longer. Which isn’t great but I’ve managed to concoct a  workaround using ‘Snippets’, comments and ‘dormant’ variables, which has sped things up for me and which could do the same for you.

Let me explain…

(more…)

HowTo: Embed fonts in a FlexBuilder AS3 project

Thursday, January 8th, 2009

A subject particularly far away from my heart; I have always loathed font embedding, because there are so many ways of doing it and they don’t always work and when they do it feels like some weird voodoo that could inexplicably disappear at any moment is part of it! Which is why I’m very grateful to have recently been shown a method of achieving this by Unwrong’s marvellous Flash Developer Jonathon Pace. Jon’s method is simple, relatively error-free and seems to work for all font types - the ones I’ve tried thus far, at least - which was always the biggest bugbear for me; it sometimes felt like you had to know a different embedding method for each different font type!

So, using Jon’s method what you have to do is:

  1. Create a fonts swc;
  2. Ensure your compiler includes every font in your swc; and
  3. That’s it! Use your embedded fonts

(more…)

Tile Designer

Wednesday, December 17th, 2008

Over the summer of 2008 I decorated my bathroom. I knew from doing my kitchen the year before that the most painstaking and time-consuming part of the job would be tiling and I wondered if there was anyway it could be made less so?

I had just come back from BarCampBrighton, where I was inspired by Ollie Glass‘ workshop on writing genetic algorithms; something that turned out to be really simple. So I sat down, chucked some code together and produced this Tile Designer swf, built on a genetic algorithm:

HowTo: Create hexidecimal grayscale integers

Wednesday, November 19th, 2008

This turns out to be outrageously simple. If you wanna create a grayscale somewhere between pure black and pure white all you need is this could-not-be-simpler equation:

var num:int = 1; // any int from 0 to 255
var grayscale:int = num * 65793;

All you need to ensure is that the value of ‘num’ is an integer from 0 (for pure black) to 255 (for pure white) and that’s it!

Cellular Automata III: Fading Walkers

Friday, November 7th, 2008

Sitting at the back of Grant Skinner’s session at ‘Flash on the Beach’ a few weeks ago i got my cellular automata classes out and did another visualisation with them. It’s really nice that they’re so easy to use, I can bash something like this out with in just a couple of hours. Again, just click the wee arrow to get going:

OK, not the most astonishing work, it would really be nice to push the envelope a bit further with it. Putting autonomous objects in a controlled environment is obviously going to be a rich vein for software, visualisations, experiments and games for the foreseeable future and I’m currently wondering quite how we can use that stuff in interesting new ways.

HowTo: Build a multi-language dynamic Flex application

Monday, November 3rd, 2008

One of the projects I worked upon over the summer was destined for the South-American market and therefore needed to display in both Spanish and Portuguese. It was a microsite built in Flex and needed the capacity to alternate between these two languages at any given time. From the user’s perspective, a single button click should be sufficient to translate the entire site’s text from one language to another instantly. Looking around the web I couldn’t find any answers so I sat down and worked out a solution myself.

Here’s a sample app using English and my second language Swedish:

(more…)