Orange is my favorite color

I’m sitting here watching Kevin Hoyt’s FlexCamp preso at about 9:40pm. This event is pretty nice… although security here at the Adobe building south of Market in San Francisco is absolutely nazi, this is definitely a cluetrain event. It’s a conversation with 300-something customers here all toying with beta software trying to build the newest overnight sensation, or at least learn how.

We saw a couple of demos including MixBook.com and RocketSlide.com, both of which were snazzy. They didn’t talk too much about the actual work or complexity level of building with Flex (say, as opposed to by hand with Flash or using Ajax) but the result is clearly cool: drag and drop, media interaction and manipulation, etc.

Some of the complaints about Flash I have heard before are the difficulties in skinning an application. They previewed some Fireworks integration with specially formatted files (where layers have a special naming convention mapped to the pieces of a component skin) that looked really nice. It certainly puts the skinning part in the hands of the designer and with just a couple of automated build scripts, the entire thing is cut up and provided to the developer. They even have a mechanism for scaling the edges of bitmaps without artifacts for when component instances (say, a button) are scaled on the stage. This was one colossal reach-around back in the day of Flash 6 RIA development and one we struggled with to the Nth degree. Nice to see progress here.

While I’ve been half-listening (and enjoying a beer and pizza, thanks Adobe!), I’ve been trying to build a simple Flex consumer of my existing calendar web service for MotorsportReg.com. I don’t think I paid enough attention at Flex 101 today but it took me about 3 hours to figure out the dataProvider binding has to reference the element level of the XML you want to loop over. So, for example, if your “collection” is a couple of nodes deep in the xml:

<calendar>
<event>
<organization>BMWCCA</organization>
</event>
<event>
<organization>Audi Club</organization>
</event>
</calendar>

Then in Flex, your DataGrid (or other binded control) needs to reference:

<mx:DataGrid id="cal" dataProvider="{srv.lastResult.calendar.event}">

And NOT srv.lastResult or srv.lastResult.calendar. That took a long time. But hey, now I’ve got a cool little Flex widget I can distribute to my customers as a Flash file and they can embed it into their website for a personalized calendar. Sure, I could have done this with Ajax as well and I might, but other than one dopey error, I did most of the work in about 30 minutes.

Cool.

1 Comment

  1. brian said:

    on August 17, 2007 at 10:29 am

    Here are some notes I took that I’m capturing for future review:

    {} brackets used for data binding (pretty basic)
    Using typing in AS3 improves performance – so use it
    Create custom classes like:

    package com.ted
    {
    import mx.controls.button;
    public class MyButton extends Button
    {
    ...
    }
    }
    // then use like:
    <ted:MyButton label="..." />

    Flex compiler has a -keep property that will dump all generated .as files for inspection
    Flash 8 SWFs can talk to Flash 9 via LocalConnection (otherwise they are sandboxed)
    Flash-Flex connector kit lets you export MC as Flex Component for use as <mx:… />
    Scale9.com has theme packs for flex; crack one open to see how its built.

{ RSS feed for comments on this post}