Archive for April, 2008

And another one – CollapsableTitleWindow grows up

Hi folks,

Thanks to everybody who commented on the CollapsableTitleWindow, I really appreciate that 🙂
I just wanted to let you know the current work in progress reagarding the CollapsableTitleWindow, the following things are being implemented at the moment:

  • Adding a max/min width and height (already done, but I will let you see the code with the update)
  • Fix the annoying bug when compiling for Flex 3 (there might be two versions in the future – I appologize but adobe has changed the BorderMetrics calculation)
  • Let the window push forward if clicked anywhere – not only the titlebar.

I think the update might be ready this weekend, we’ll see. Stay tuned.

Using Flex Image events to show a preloader

Today I wanted to show a simple preloader in an itemRenderer that just contained one Image. The problem was to get the image’s events before it was too late since you just can’t catch the OPEN, PROGRESS or COMPLETE event via MXML (Why did’t they just add the metadata for that?). I have seen quite a few approaches which extended the Image class but I wanted to use a custom Image class (SuperImage) to use it’s caching capabilities. So here is the example, I’m using a normal Image here but you can use any derived class you want, it just has to use the 3 events: (You might use the following as an ItemRenderer)

(Argh! WordPress destroyed the source code, I’ll repost it soon)

That’s it, using states it isn’t too hard to change the UI. If you need cool preloaders go checkout – they will generate a gif which you can easily import into the Flash IDE to convert it to swf.