this space intentionally left blank

March 20, 2008

Filed under: journalism»new_media


This CQ story features an interactive Flash graphic by yours truly. The story is pretty cool journalism, in my opinion, and the graphic does several things that I think are noteworthy:

  • It's aware of the ID numbers that CQ uses to identify members of Congress, and uses them to dynamically load the member portraits and profile links from our database.
  • It uses XML for the profile descriptions and names. ActionScript 3 support for XML is fantastically powerful and easy to use. It would have taken much, much longer to do in AS2. And this way, other people can edit the data without having to recompile the code or know anything about Flash.
  • The graphic is also aware of FEC IDs for political candidates, and links those to the CQ Moneyline profiles. Between this and the member ID numbers, there's real potential to capitalize on CQ's best resource: its exhaustive database of information on lawmakers and the legislative process.
  • It uses Flash's "tween" system to fly things in and out and handle opacity changes on mouseover.
These are all pretty basic steps, but as a pretty basic Flash programmer, they were fun to put together.

The UI is almost all generated programmatically. This is partly because projects like this are very short-term, and so it's really just as fast for me to define everything in code as it would be to create something more maintainable. But it is also because, as I've learned in this and a previous project, Flash's UI elements can be frustratingly primitive. Items like textboxes and lists are not really fully-developed components, they're clever attempts at mimicking those components using Flash's vector graphics and event capabilities.

For example, the original idea was to make the lawmakers a simple listbox, and color gold those names with earmarks. Unfortunately, changing the color of a listbox in a selective fashion means subclassing the cellrenderer and creating new methods--you lost me at "subclassing," honestly. And Flash's datagrid is just a collection of listboxes, so it's much the same--no coloring or formatting individual cells without a lot of work.

Now in this case, the portraits turned out to be much better, even if it did mean writing my own mugButton object. But compared to other rapid development languages, this feels clumsy to me. I think if I were a full-time programmer, instead of someone who just has to dabble in it every now and then, it'd drive me nuts.

Not to mention how obtuse the Flash IDE continues to be--and since the Flex SDK doesn't include the tween class or some of the components I wanted to use, I was stuck with Flash. Dropping into Visual Studio (to confirm that it is possible to interact with datagrid cells at a lower level there) is a stark reminder of the difference between Flash and an environment with rich, responsive code hints and real editing windows.

Future - Present - Past