AS3
February 28th, 2010 | AS3, Flex | David Spanton
This is the first of a two part series on using Pixel Bender filters in Flex effects. I’ve recently started to spend a bit of time with Pixel Bender and have found it to be a good tool for creating interesting effects and transitions in Flex. Even if you don’t write any yourself, there are plenty available to use at the Pixel Bender Exchange
In this first part I’ll cover an example of making an Effect and EffectInstance that extend the Flex framework and also use a Pixel Bender filter to achieve the effect. In the second part I’ll cover writing a Pixel Bender filter to use with a custom effect.
I won’t go over embedding and instantiating a filter as a Shader; this is well documented here. There is also a good example of animating a Pixel Bender filter here.
Read the rest of this entry »
Tags: dissolve effect, effects, filter, Pixel Bender, Shader, ShaderFilter
February 5th, 2010 | Air, AS3 | David Spanton
Following on from my previous post concerning dyncamically resizing AIR windows with user resize (based on Daniel Wabyick’s example here), I wanted to cover a further modification I made; that of having the window resize dynamically, but the content stay the same.
To be more specific, I wanted a content area to remain a fixed size when the window resized dynamically, but maintain a percentage width of the area when the window was resized by the user. (If that makes no sense, download the example after the jump.)
Read the rest of this entry »
Tags: dynamic resize, Window
January 28th, 2010 | AS3, Bitmap, Flex, Image | Matt Bryson
If you have ever used the Flex Image component, set its minWidth / minHeight or percentWidth / percentHeight you may have noticed some strange layout issues, and that the scaled quality is not that good.
You can use 3rd party Image components to get round these issues, or this very simple load handler on the image.
Read the rest of this entry »
January 12th, 2010 | AS3, Flex | Matt Bryson
The Alert class in AS3 is a good example of using bitwise flags to specify a configuration without having to set lots of separate Boolean flags.
Its also very easy to create bitflags for yourself, which save time, code and memory! Below is an example of custom bitflags as well as an explanation of how it all works.
Read the rest of this entry »
Tags: AS3, Bitflags, Bitwise operator, Flex
November 13th, 2009 | AS3, Flex | Matt Bryson
A quick and easy way to render HTML text with the body of a Flex Alert box.
Read the rest of this entry »
Tags: Air, Alert, Flex, HTML Text
November 13th, 2009 | AS3, Flex | David Spanton
Using your own namespaces can be a good way to add another level of access control to class libraries that sits somewhere between public and internal.
If you want to expose methods to classes in different packages, but not make them readily available to the whole of the outside world then this is a good way to do it. The Flex framework itself makes quite heavy use of the mx_internal namespace for inter-package communication and undocumented APIs
Read the rest of this entry »
Tags: mx_internal, namespace
October 14th, 2009 | AS3, Flex | David Spanton
I recently found myself with the task of configuring a date format for a new client. The format that was specced looked something like:
Wednesday 14th October, 13:33
It was at this point I realised there is no support for the ‘th’ (or ‘st’, ‘nd’, ‘rd’) part of a date in the Flex DateFormatter.
Rather than mess around with the string after it had been formatted, I had a poke around the DateFormatter’s source code and decided to write an extended date formatter which added support for date suffixes.
Read the rest of this entry »
Tags: DateFormatter