Architectural Atrocities, part 8: is there no equality?

The collections in Flex are good as data providers for list and tree components, doing the dirty work of making sure that the components know of changes made to the underlying data, but frankly they suck at most other things. Most importantly they suck at being collections. In this post I’m going to show you why and how to alleviate the problem somewhat.

Read the rest of this entry →

MXMLC WTF (7): Snooping with verbose stacktraces

The -verbose-stacktraces flag to mxmlc is really useful, but it also has a fun, but disturbing, side effect: you can discover how the person who packaged a swc organized their project. If an error is thrown in a context where the call stack includes methods defined by classes inside a swc the getStackTrace method on Error reveals the location of the .as file as it was when it was compiled.

Read the rest of this entry →

Finding the debug version of Flash Player for Leopard

If you have installed Leopard and want to be able to upload files but at the same time debug your Flash and Flex applications you can find the debug versions of the prerelease player (that has the file upload fix) in the Flex 3 SDK nightly builds, just download, unzip and look in the “runtime” directory.

This wasn’t obvious to me, and I spent a long time hunting it down. I hope this comes to use the next time someone googles for leopard debug flash player.

Edit Since 10.5.1 came out, this became a little less useful. Go with the release version for development instead of using the nightlies.

Edit This page http://www.adobe.com/support/flashplayer/downloads.html lists the latest version of the release debug player.

A generic way to remove an event listener

This might be obvious to everyone, but I thought I’d share a snipplet containing a generic way of removing an event listener:

event.currentTarget.removeEventListener(event.type, arguments.callee)

Place it in your handler function, I prefer to put mine on the first line.

It’s useful in situations where you want to stop listening after the first event has fired, for example. You can use it when the listener is an anonymous inner function, if you don’t know the type of the event, if the dispatcher is unknown or any combination of these.

Most of the time using weak references is probably more appropriate, but in some situations the snipplet above is handy.

Read the rest of this entry →

Asynchronous API:s and garbage collection

The asynchronous API:s in Flash, Flex and AIR don’t all work the same in regards to garbage collection. I discovered this the other day when testing out file uploading in Flash. I made the mistake of not keeping a reference to the object that was going to dispatch events when the user had selected a file. It took me half an hour to figure out what was happening, and once I did I cursed myself for not seeing it straight away. However, after having thought about it I think that the the Flash, Flex and AIR API:s are inconsistent and a bit unintuitve on this point.

Read the rest of this entry →

The first file I’ll remove after I install Leopard

/System/Library/Speech/Voices/Alex.SpeechVoice

Because I’ve never used the speech feature of Mac OS X for anything serious* and 669 Mb for one voice, one voice, is just silly. It can’t be that good.

Just look at the monster http://www.jonathansaggau.com/blog/2007/10/yeah_it_breathes.html.

* I have, however, used it. My favourite use is ssh’ing in to a server that is located under the sofa in a friend’s living room and running say "feed me!" a few times.

TextMate Flex tips, part 2

It’s been a while since I wrote about TextMate and Flex, but still my last post is one of the first five when I google for “textmate flex“, “textmate flex bundle” or “textmate flex tips“. This surprises me as I thought that by now there should have been more written about Flex and TextMate by now, after all it’s been almost ten months. It turns out that there actually has been things going on, but in the quiet.

Read the rest of this entry →

There is actually more to Flex 3 than just the version number

Three months ago I asked is the only thing new with Flex 3 the version number?, I was bit critical back then, but I take it all back.

Why?

OpenType font embeddning. Absolutely fantastic.

The enhanced constraints feature isn’t so bad either.

Flex WebServices, problem with <any/>

A while back I wrote about using Flex with Amazon WebServices and the problems I had using Flex’ WebService component. Now I’ve tried working with web services in Flex again and discovered new problems having to do with Flex’ serialization of the request when the data type of a parameter is <any/>.

Read the rest of this entry →

The Failure of CSS

By way of Ajaxian I came across a post by Alex Russel on the failure of CSS and how CSS 3 just doesn’t solve any real issues. I can’t tell you how glad I am that for my career as a web developer chose Flash and Flex instead of the Ajax path. One large contributor to that choice was my disappointment that CSS never actually made layout for the web any easier.

Read the rest of this entry →