Site search

Categories

July 2009
M T W T F S S
« Apr    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Friends

Auto size button for Flash components

I’ve recently been working outside of Flex in standard Flash & Actionscript, so I thought I’d take the opportunity to try the CS3/4 components. They’re much leaner than their bigger brother’s, and as a consequence don’t offer anywhere near the functionality, but their simplicity means they’re fast and easy to work with.

I ended up tweaking most of the components in some way or another. The most important tweak was to create an auto sizing Button. The standard Button doesn’t change it’s width based on the label length, which is crucial to any web project these days, especially if it’s multi-lingual. So here’s my solution, with both an example and the code:

Read more »

Bindable interfaces with custom events

I’m surprised I haven’t stumbled across this before, but it caused a little head-scratching in a recent project. The problem involves having a class with a mixture of binding tags (i.e. with and without custom events), but assumes you are programming to the interface the class implements. In this case making it bindable proves a little unintuitive.

Imagine you have an class called Artist with two getter/setter properties: name and age. One of them uses a standard binding tag: [Bindable], the other uses a bindable tag with a custom event: [Bindable(event="artistAgeUpdate")]. Now you may be inclined to copy the tags into your interface and paste them above the getter/setter pair, like so:

Read more »

Quality Glow and Blur Flex effects

The Glow and Blur effects are useful tweens that can be used to animate flash filters in Flex, the only problem is they don’t implement the quality property. It’s hard coded at a value of 1. In most cases this isn’t an issue, and where performance is concerned it’s best left unchanged. But having the extra control doesn’t hurt, especially considering a quality of even 2 or 4 can dramatically increase the smoothness a filter.

Adding the quality property onto Flex effects is quite simple, although it does require overriding two of the effect classes and duplicating a small amount of code. Below is an example of the new glow effect and the steps required to implement it.

Read more »

Overlapping TabBar in Flex

On a recent project I needed an overlapping tab bar, something that the default Flex TabBar doesn’t implement. While you can can easily change the spacing between tabs using a negative horizontalGap, you cannot retain a top-of-the-pile-like status for the selected tab. They are permanently stacked left-to-right on top of each other.

There’s a solution out there that relies on clever skinning techniques, but it’s a little time-consuming and inflexible. So after some poking around inside the Flex framework I discovered the underlying problem and came up with an alternate solution.

Read more »

New blog for 2008

I’ve decided that what I should really do is start a new blog. I’ve been using other people’s blogs as a source of information and trouble-shooting for many years, and I think it’s finally time to give back some of the good karma. I’m going to share some of my Actionscript and Flex knowledge with the rest of the world.

Of course writing about something that hasn’t already been documented in obsessive detail by a fellow nerd is always hard, especially with the deluge of blogs out there. But just maybe I can document a problem nobody’s encountered before, and someone, somewhere will benefit from what I type. And if it all goes wrong then I’ll just write about things I like.