Workout Week in Your Pocket

Published last year, at the end of March under Design, Software

Pocket ScheduleI’ve just built a cool new print feature into Workout Week—the ability to print foldable pocket guides that list your entire workout schedule for the week. It’s a pocketmod–inspired idea, and it makes a lot of sense to provide a workout schedule you can realistically take with you to the gym. I’ll continue to refine the pocket guides as I develop the site, but it’s nice to throw up a quick 1.0. Check out the guide for the cross-training schedule here, or click the print button on any workout schedule. Below I’ll talk a bit on the implementation details, and what could be done to speed things up.



Print Screenshot

Love / Hate Flash
I built the pocket guides using Flash 8—they all dynamically pull their content from the XML files behind each workout schedule, so theres no additional support work on my part to keep them running.

I first set out using Flash to pull data from the XML file directly. After hours of frustration, I wound up choosing a PHP solution to serve flash data as a flat variable list. The XML parser built into Flash is horribly slow and buggy compared to the amazing simple_xml in PHP. Flash breaks when you don’t inform it of unexpected XML comments or type declarations, and the debugging tool was completely useless in this regard.

However, when it comes to printing, Flash is amazing. The printJob class (which I believe is new in Flash 8 ) makes it incredibly easy to define exactly what part of the frame to print, even if its outside the visual area of the frame. The entire pocket schedule actually renders in the flash movie, but it is hidden outside of the visual area - leaving only the “Print Guide” button showing. Using printJob, I was able to tell Flash to only print the hidden schedule, leaving the button outside of the printed version.

Re-factorings to come
I’