Flex/Flash/Actionscript

Using complex headers with the Flex Accordion

Here’s an example of how to use complex UI components for the header renderers of a Flex Accordion component. Normally the Accordion only allows you to specify a Button as the header renderer, and any customization still requires you to subclass Button, so it’s hard to get full control over the headers. The CanvasButton component in FlexLib is an extension of Button that acts like Canvas, which means that it subclasses Button but allows you to easily add children via MXML.

I’ve created a special extension of CanvasButton that is specifically for use as a header renderer in an Accordion. The new CanvasButtonAccordionHeader (nice name huh?) is now in the FlexLib SVN repository. Note that this is in the FlexLib SVN repository but is not in the zip distribution on the main FlexLib page yet, once we get a few more updates I’ll update the .zip distribution. For now you’ll have to get the source from the repository.

The example below shows using a header renderer for the Accordion that display a ComboBox and a CheckBox in the header. The point here is that since you’re effectively using a Canvas as the header, you can easily add whatever UI components to the headers that you want.

Browse the MXML source of this example.

This movie requires Flash Player 9.

Standard
Flex/Flash/Actionscript, Uncategorized

Some clips from my 360Flex presentation

Here are a few small video clips from my 360Flex presentation. The first is my favorite moment in the presentation when I get applause for saying “God damnit, make that protected.” 🙂 And the second clip is 7 minutes of the presentation where I talk about monkey patching (or “underriding”) the core Flex framework classes. I thought this was one of the cooler parts of the talk, so I decided to post the video of that section. You can get the full video (1 hour 20 minutes) of the presentation here.

The videos are licensed under Creative Commons license, so I’m supposed to do some attribution thing. They were filmed at the 360|Flex conference that was put on by John and Tom, video work done by Bryan Zug. You can get all the videos here. Cool?

Standard
Flex/Flash/Actionscript

FlexLib updates: new IconLoader component, bugfixes

A new component has been added to FlexLib: IconLoader from Tobias Patton, which allows you to load .icns (Mac OSX) or .ico (Windows) icons into your Flex projects.

New component: IconLoader
The IconLoader component converts a Macintosh OS X (.icns) or Windows XP (.ico) icon file, along with its alpha mask, to a Flex 2 UIComponent.

Documentation | Example | Contributor: Tobias Patton

New component: PromptingTextArea
This is exactly like the existing PromptingTextInput in FlexLib (is that perhaps the most-used component in flexlib?). Same thing, extends TextArea and allows you to specify a prompt to be displayed when the text area is empty.

The changelog for FlexLib .2 release:

  • Added PromptingTextArea
  • Added IconLoader
  • Added case-insensitive option for Highlighter
  • fixes for issues 35, 45, 47, 50

Keep reporting bugs! I do monitor the bug list and make fixes.

Also of note is that this is the first “corporate” contribution (outside of Adobe). Tobias Patton developed the IconLoader while working for EffectiveUI. We encourage companies to contribute components to FlexLib. You’ve got to release them under the MIT license, but we give you credit on the contributors page 🙂

Standard
Flex/Flash/Actionscript

Presenting at Lunch 2.0 at Adobe on Friday Sep 14

Come on by Adobe’s SF office this Friday from 4-6 pm for Lunch 2.0 (lunch at 4-6pm? wtf?). I’ll be showing off some cool Flex/AIR stuff (read: bouncing tilez!). I think the whole event is pretty informal, so come on by and hang out.

Side note for alcoholics: I asked if there was going to be beer and I was told there will be pizza. So I’m a little worried about the booze situation. Dear Adobe: you have set the bar very high with the past Flex events. It is now expected that we will walk in, get handed free software worth hundreds of dollars, and have all-you-can drink beer. If not, the Microsoft Silverlight Dev Camp will have drinks from 7-10 pm that same night. AND they might be taking people out for drinks after 10. I say we all walk from Adobe to the MS event after the Adobe one finishes. We can all wear Flex jackets, roll over with a hundred guys, and challenge the Silverlight devs to a street brawl. At the moment the Adobe rsvp list is 178 deep, while the MS one only has 89. We can take ’em.

All joking aside, if people actually do want to go from the Adobe event to the MS event, I might be down to walk over. I’m technology agnostic when it comes to free booze.

Standard
Flex/Flash/Actionscript

Download My Recorded 360Flex Presentation Video

The 360Flex folks have posted some of the recorded videos of the conference. You can see them all here, or here’s a direct link to mine. You can download the whole thing (my video is 280 megs). They’re selling the vids for $3.60, I think I get some kickback if you buy mine, although I’m unsure of the details.

So buy that! I’m gonna make millions. And I’m competing with Juan Sanchez for video “views,” so if you just want to go to the page and hit refresh a lot on my video that would help 🙂 I’m gonna be a millionaire AND a cheat!

Standard
Uncategorized

Facial hair as a measure of coding progress

Not sure if I’m the only programmer who does this, but I often use my facial hair as a visual indicator of how long I’ve been working on a project. I typically employ this technique on short projects with a lot to accomplish and little time to do it in. For example, yesterday I finished a project that was originally scheduled for about 3 full weeks. After week one we figured out that the deadline was 2 days before we thought, so we lost 2 days off the last 2 weeks, which is a fairly substantial portion of time on such a small timeframe (and don’t forget to add in labor day weekend festivities). So the shaving stopped (showering continued on a sporadic basis). Honestly, when you’re in a time crunch there simply aren’t enough seconds in the day to shave. And I like being able to look in the mirror and have a visual representation of the work I’ve been doing. An added benefit is the refreshing feeling that comes after work is done and the scruff is removed. Ahhhh, vacation time…

facial_hair.jpg

P.S. Yes, that’s just under two weeks of hair growth, my facial hair is pathetic, I can’t grow a real beard. You can stop making fun of me now.
P.P.S. I swear I’m going to get back to Flex related posts soon. There’s gonna be a bunch of flexlib updates coming. w00t

[UPDATE] Tink and Ben Stucki posted WAY better examples than my own. I had to share. If you’ve got anything better post a link in the comments.

Standard
Flex/Flash/Actionscript

Yes!! Thank you Flickr for crossdomain.xml

Throw away those Flickr proxies! They added an open crossdomain file on http://static.flickr.com. Fuck yeah! Read the blog post here. You can see the crossdomain file here: http://static.flickr.com/crossdomain.xml. Thank GOD. I no longer need to route every single Flickr image through my server just to get access to BitmapData for an image. This is one of those things that bugged me so much about Flickr. They gave us a nice open crossdomain file on their server we use for api calls, but not on the server that gives us images.

w00t!!

P.S. I usually don’t do these rehashing of blogosphere posts, but this one makes my life a helluva lot easier, so I wanted to share in case anyone missed it.

Standard