Archive for October, 2006

My 10:30 Wednesday MAX preso…

So, my first attempt at live coding failed. It turned out it wasn’t the code – it was a silly thing I forgot to do in FlexBuilder in the heat of the moment! I wanted to show how trivial it was to write a dynamically loadable module that used bidirectional communication between the loader and loadee, so I prepared a WidgetShell (like a dumb portal) that would read an XML file containing a list of Widget SWFs to load.

Basically, FB doesn’t present a way for you to create a new ActionScript project where the main class extends a particular base class or implements an interface. You have to hand-add that. However, if you add a class, you get prompted and it will codegen the interface methods for you. Very handy when you’re on stage and can’t remember all the methods you need to implement for that module project.

So the trick I discovered was that you can delete the autogenerated class, and add it back at your leisure. For my preso, I left the (empty) project stub in place (which mostly just contained overrides of the src and bin directories) and planned to add the live-coded widget implementation.

I totally forgot that you then need to mark that new class as the executable application for the project! D’oh! It never even compiled my widget!

Oh well. Perhaps my 4:30 Thursday preso will be a bit more coherent and less coffee-addled. :-)

Stay tuned, I’ll be posting my demo code as a zip in the next day or so. The copy of the preso in the library doesn’t have the best notes in it, so I’ll post that as well.

MAX, modules, and other stuff…

I’ve been incommunicado in the blogosphere because I’ve been tweaking the compiler to fix some issues discovered in 2.0 that would get in the way of modularizing your app.

If you’re one of the lucky few who have had a chance to play with 2.0.1, you’ll also notice that mx.modules is official!


I’ve put in numerous refinements since the prototype I posted to my blog a while back, including:
- Both low-level AS API and high-level MXML-oriented declarative API supported
- MXML modules fully work and do the CSS thang
- Runtime stylesheets are now possible and are built using modules!
- You can stream extra classes after the application by using the -frame configuration option.
- There’s a dictionary weak-key approach for releasing but reacquiring modules such that they may reload quickly if they didn’t get dumped via GC. This should be handy for apps where you’re only ever visiting one giant module at a time.

I’m pretty happy with it all, and hey, guess what? I’ll be talking a lot about modularizing your app (the general issue, but I’ll touch on mx.modules) at MAX in two workshop sessions titled “Techniques for Delivering Modular Flex Applications”, on Wednesday at 10:30 am and on Thursday at 4:15 pm.

In other news, I’ve decided to move over to the Player team. The compiler has started to stabilize, which is good for you but not as much fun for me. I’ll be dusting off my C++ and getting my hands dirty at a lower level. I’ve gotta say, I’m looking forward to it!

See you at MAX!