Flex Development

by Harry B. Garland

Tripping Over my Own Data Bindings

I just learned about a little “gotcha” in Flex, and I’m writing to warn you about it. A counterintuitive behavior involving Flex data bindings. And of course it’s just my luck to run into this kind of thing when I’m in the middle of trying to learn Cairngorm, (which so far is the greatest feat that I have attempted as a Flex developer).

So here’s the hitch: I have an mxml component. (It’s part of the View layer in the MVC pattern.) It has data bindings to the ModelLocator singleton (the central repository of application data). One of the data bindings needs to invoke a setter so that custom code can be run to react to the data model change. Specifically, here’s the code that I’m talking about:

    <mx:Binding
        source="model.isStreamConnected"
        destination="isStreamConnected"
    />
    <mx:Script>
        <![CDATA[
            private function set isStreamConnected(inConnected:Boolean):void
            {
               ...
            }
        ]]>
    </mx:Script>

Next, I want to bind the same data to the ‘enabled’ attribute of my media controls container, so that the controls will be disabled when it’s not connected, and enabled when the stream is connected. So I include this:

    <mx:Canvas
        styleName="MediaControls"
        enabled="{model.isStreamConnected}"
        >
        ...
    </mx:Canvas>

Although this seems like a perfectly reasonable way to use data binding, the problem I encountered is that even after the stream was connected, the canvas remained disabled.

October 10, 2007 Posted by Harry B. Garland | Uncategorized | , | No Comments Yet

Prelude to a Flex Blog

When people find my website, www.hgarland.com, they’re going to notice whether i have a blog. When i go to a website that contains useful information, I expect it to have a blog. That’s what i look for. If it doesn’t have a blog, the site looks incomplete. It just has empty white space where I expect the orange icon to be.

Suddenly blogging has hit me.
There’s a lot of Flex bloggers that went to Adobe MAX 2007. I learned a lot more about MAX from my blog subscriptions than i did from any computer magazine or mainstream tech news website.

I see the path and future of blogging.
Blogging is going to change software development.  There is a ton of information out there about Flex in the Blogosphere.

With blogging, I can specifically opt-in or out of any blog at any time.  Every blog has individual accountability, so I can turn off anybody who fetters my blog subscriptions with ramble.

The power of blogging extends beyond the world of Flex development.
This blogging thing is gonna be a whole revolution when it catches on in the political arena and everything else where information has been controlled or locked up. The mainstream newspapers aren’t going to be able to filter the everyday messages that people hear anymore because the everyday messages will come from more and more everyday individual sources.

As a developer, i no longer have to be a passive sheep by only learning about the fads that a few mainstream magazines have caught onto. I can actively pinpoint individual nodes of knowledge that make the most sense to me. As an early adopter, that’s important because bloggers are faster to describe emerging technologies.

Blogging is a system of many people and many actions.
I also think that blogging has a reinforced strength in its ability to be a 2-way communications device. I subscribe to a few Flex blogs, and sometimes one blogger I know posts a comment to another blogger’s post. This creates a conversation-like environment, and enables me to focus on many different and informed angles of blog posts that interest me.

What I have discovered from this, is that the system of blogging works even better when everybody becomes actively involved in all parts of blogging, from production to consumption to replying.

So I’m giving a shot at the former.

October 10, 2007 Posted by Harry B. Garland | chat | | No Comments Yet