Archive for the ‘Flex’ Category

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…)

Flash & Flex Freelancers in Brighton

Friday, November 21st, 2008

Spurred on by this page on Kristen Akermans’s site and this blog post on Matt Pearson’s blog - which both list freelancers available in Brighton and which both link kindly to me - I decided I should return the favour. So what follows is a list of those people I recommend if you’re looking for a freelancer. Obviously I top my own list - I’ll be wanting the work first, thank you :) - but if I’m busy I thorougly recommend the other guys and gals (listed alphabetically) here:

Designers

Charis Mystakidou: wiredportfolio.com
Kristen Akerman: sting.co.uk
Luke Hornsby: flamingpixels.co.uk
Tim Frost: bullandgate.com

Developers

Richard Willis: richtextformat.co.uk
Matt Pearson: actionscripter.co.uk
Matt Sayers: soplausable.com
Neil Manuell: revisual.co.uk
Nikos Chagialas: devgallery.com
Owen Bennett: steamboy.co.uk

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…)

HowTo: Force Flex to apply width & height with CSS (and PureMVC)

Sunday, October 12th, 2008

I love the tools I work with but if I’m being honest, some things just don’t measure up. CSS in Flex for instance: it doesn’t do half the things a genuine CSS implementation should do. Thanks go to Tom Kennett for bringing to our attention this great blogpost about just how far short of the mark Flex’s CSS support falls.

One of the most irritating aspects is the fact that the ‘width’, ‘height’, ‘percentWidth’ and percentHeight’ properties of UIComponent - which is the base class for all visual components - are exactly that: properties, not styles. That means they can’t go into the CSS, they have to be added to the mxml tags themselves:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application 
  xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:VBox width="100%">
    <mx:HBox id="header" width="100%" height="80" />
    <mx:HBox id="content" width="100%" height="100%" />
    <mx:HBox id="footer" width="100%" height="50" />
  </mx:VBox>
</mx:Application>

Even in an unrealistically small file like this, the ‘width’ and ‘height’ attributes make it difficult to read. When working with actual, lengthy .mxml files, a bit of simple editing can become like hacking through the jungle. I’m not really into that so I thought I’d sit down today and see if I could concoct a workaround that would allow me to put the ‘width’ and ‘height’ declarations in the CSS instead.

(more…)

Where have my swc graphic assets gone?

Saturday, October 11th, 2008

There is a fantastic technique for getting graphics drawn in Flash into Flex by means of classes compiled into a swc. It’s a really nice little method and if you wanna learn about it Ultraviolet Design have a great post about it here. I’m pointing you towards their post as this post is not going to be about that. Instead it’s going to be about what happens when that technique - which usually works fine - goes unexpectedly and bafflingly wrong.

(more…)

‘An internal build error has occurred’

Monday, August 11th, 2008

That’s the description of a problem Flex Builder just presented me with. Not too descriptive is it? With so little to go on, I assumed there was some file corruption somewhere and hunted high and low to find it, to the point of checking my whole project out from scratch. Nothing helped.

I found the problem eventually though. It was this:

switch (someValue){
 
}

That’s all: an empty, half-finished switch statement!

I’d recommend making sure you finish coding your switch statements before casually hitting ’save’ if you don’t want to waste time like I just have.