Search Flex Samples

360Flex slides and code

Here are the slides from my presentation at 360|Flex, as well as most of the code I presented. The presentation is embedded below using SlideRocket, or you can view it at the standalone link here.

That presentation is almost the same as the one I actually went with in the session (minus a few unimportant last minute edits). The hard part about doing a session that jumps between the slides and code in Eclipse is I don’t have any of the code we went over in the presentation. So here are a few of the examples that I covered, with source code.

Resizable Wrapper component
Demo | Source Code
This is a container component that adds resize handles and a drag bar that allows you to resize it’s contents and drag it around. Pretty straightforward, not too exciting. You would use the component like any other container and wrap it around the object you wanted to resize. So something like:

Adding resize handles to every UIComponent
Demo | Source Code
Now this is where we get into the cool stuff. In my talk I explained “underriding” core framework classes (I guess it’s actually called monkey patching, thanks to Tony Hillerson for teaching me this). I first learned about this technique on Michael Labriola’s blog. In this example I use the resize/drag component that I made and apply it at the base mx.core.UIComponent level. This means that every single framework class that extends UIComponent (every ui component in the Flex SDK) will have the ability to use the resize handles. No need for an extra wrapper container, or an extended ResizableImage or anything like that. It just works. Isn’t that cool?

Templating example
Demo | Source Code
I didn’t even get to this in my presentation, I ran out of time and skipped it. I’ll probably do a longer blog post about it in the next few days, but for now here’s an example with code for MXML templating. The basic idea is that I created a base “media player” class that included a progress bar to indicate the playhead time and a play/stop button. Then I used that class as the “template” and extended it to play a wav file and display the filename. Then I extended that to play an mp3 and display the id3 info in the component. And the last extension plays a video and displays the playing video in the component contents.

Thanks to smart people
A HUGE thank you goes out to all the awesomely smart people in my session that ran the thing for me. I’m going to write up a more detailed post with my thoughts on how the session went later, but I want to give a big thank you to Deepa Subramanian (for just being overall badass and answering a ton of questions), Andy McIntosh (for rocking the commitProperties discussion), Tony Hillerson (for monkey patching his way into the session), Adam Flater (for teaching me about [Mixin]), and David Coletta (for sharing his experiences with custom components while working on Buzzword). The session was fun because I got to sit back and let these guys teach everyone how to do custom component development.


Related Flex Samples

Learn Flex: Flex Samples | Flex Video Tutorials Flex Examples