Blog

  • How big are my Flex classes?

    Joe Berkovitz has an entry here about a Java class in the free Flex 2 SDK that exposes how big each of your compiled ActionScript classes are in a given SWF. When an ActionScript class is compiled, it goes through a series of steps to become bytecode, a smaller size, more machine friendly format called “abc”. So, your 6k ValueObject could become 1k, not including the additional LZW “ZIP” compression that the Flash Player has built in for it.

    For Flex Developers, this is valuable if you are trying to reduce the file size of your Flex app, usually in the case of a publicly accessible application. If 9 million people a day are accessing your SWF on 12 Akamai servers, it behooves you to make her as small as possible, even if money is no option. However, one of the biggest problems with modules, a feature in Flex 2.01 that allows you to separate parts of your application out into “dynamically loadable DLL’s”, is there really isn’t a straightforward way to understand what parts of your application could benefit from modules.

    For example, as a GUI developer, I can pretty easily look at a design comp, and identify which parts would benefit from being loaded on the fly, and which are fine to just keep in the main SWF given the file size and performance requirements. If file size is important, later forms I can “load later” via a module so the larger PNG graphics don’t get included in the initial download. The user doesn’t need to see that form immediately, so I won’t make them download it immediately. The same goes for classes that aren’t seen. The code that makes up the form, for example, can only be download when the graphics that make it up are downloaded as well. Both of these can be packaged up in a module, and loaded on the fly later.

    Regardless, that’s good foresight, but extremely subjective. I have no solid evidence of the classes size, including dependencies, just the PNG graphics size once I rip them out of the PSD /AI file. Furthermore, if the form has an initial transition, and it is choppy because the form has to load a lot of assets into memory when it downloads and then plays, the designer will give me hell. Thus, we are back to having very subjective decisions guide our choices of which classes / assets go into modules, and those who stay in the main SWF. Not a very good way to make software.

    Another example is, “He’s over 2000 lines long and the user barely ever hits this complicated form until the very end of this wizard… let’s invest time making this part a module because we ‘guess’ it’ll help.”

    Joe Berkovitz’s Apollo app should help change that. Using the Java class in tandem with a Flex Tree and WebKit HTML control, you can get a visual breakdown of how big each class AND package is in your code base. Joe wants to code some additional “smarts” into the code to proactively identify some key bloat areas that could be broken down into modules (if I read his entry correctly). Even if he doesn’t, just a Tree with file sizes like he shows on his blog is enough for me to make more informed architecture decisions.

    Send Joe cookies so he finishes this app.

  • Flash Player 8 Effects in Flash Lite 3?

    Alessandro posted a Flash Lite 3 video example shown at a financial meeting. Sharp-eyed Zeh wondered if he saw a motion blur. A lot of video codecs will compensate for fast-motion by blurring so you don’t get the hardcore pixelation from a non-keyframe, and all in all smaller file size. However, the phone ISN’T moving and since that appears to be some form of component with dynamic content in it, that means they couldn’t have done it by hand (say, using Photoshop or After Effects). I say it’s a motion blur. Good eye Zeh!

    If what we are observing is accurate, that means Flash Lite 3 will have the Flash Player 8 effects. Furthermore, that also means it’ll most likely have the new Garbage Collector that they put in Flash Player 8 with mark & sweep in addition to reference counting. That’ll help kill the unintentional circular references, and give us more reliable memory usage on an already constrained set of devices.

    That still leaves the new AVM and ActionScript 3. I made an effort, although not a huge one, to mention Flash Lite 3 around any Adobe employee at WebDU 2007 who had any association with alcohol. The general plan of attack is you start a conversation with them, start bitching about some of the design challenges you have with the current technology (in a positive way, not annoying) so they feel the need to satiate your concerns with hints at future technology solutions… say, new features in Flash Lite 3. Once you get that, you then go find another Adobe employee near alcohol, and do the same thing. The goal is corroboration. If you can get 2 unrelated employees hinting at a new feature, you can pretty much be sure… as sure as one can be anyway if you don’t work for Adobe and aren’t on any beta’s.

    Nothing. I got nothing. In fact, I think they were making with the local “take the piss out of Jesse” culture and screwing with me. Either that, or it was my approach. ::shrugs::

    If one were to levitate up to 30,000 ft, it seems to me all the engineering efforts around AS3 and the new AVM with focus on developers are going towards Flex 3 & Apollo. On the designer front, they are all going towards Photoshop, Flash, and Flash Lite since more designers are employed in the Flash & Flash Lite arena. Lame, I want both. Anyway, at least Moxie will hopefully address some of the designer / developer work flows as well as making Flex’ Design View a little more extensible. Wish I could say some more concrete things about Flash Lite 3. Video’s neat, but I STILL need to code those solutions. I’m sure the cliche response by now from experienced Flash Lite dev’s is, “No you don’t…”.

  • What I learned about the Wii at WebDU

    wii_no_chuk_guardian.jpg

    Dale and I played some mad tennis on the Wii. The next morning, both of us had a majorly sore right arm. I realized if I did that for 3 months I’d become Reggie from Lady in the Water. ‘Course, if you’re planning on hunting scrunts, there is no better training! Definitely plan on getting one for my birthday since I am really disappointed in the game selection for my XBox 360.

  • WebDU 2007 Preso: Shuriken Component Framework for Flash Lite 2.x

    Shuriken is an open-source component framework for Flash Lite 2.x I started on back in September of 2006. I’ve uploaded some examples that showcase the different components that you can use from Shuriken as well as 2 example Flash Lite 2.1 applications. You can read the why’s and how’s at the project page. You are welcome to contribute to the project as well via writing code, writing docs, and/or whatever. Any feature / component requests, we’re all ears.

    Finally, big thanks to Greg Burch from Adobe’s Mobile Dev team. He was a really big help in many areas including performance, API feasibility, and code reviewing.

    oz_2k7.jpg

    I travelled to Sydney, Australia for WebDU 2007 to speak about Shuriken. Always a great conference; low key, personal, and savvy sophisticated attendees. Good speaker to attendee ratio as well. Thanks a lot to the Daemon team. 5 years on and it’s still the best Flash / Flex related conference I’ve been too. Maybe next conference I’ll pick a less obscure topic so my wife doesn’t get the bigger room for her presentation… *ahem*.

    Shuriken Project Page

    WebDU 2007 Preso