So You Think You Can Bind? – A Flex Puzzler
Continue Reading February 19th, 2009 Brian Gray
In my opinion, binding is one of the trickiest concepts for a Java developer to really understand when first learning Flex. It’s not because it is overly complex, but because binding is similar enough to other concepts in JSP, Swing, etc. that we begin to form mental models without fully understanding the differences. But those subtle differences are important for the last 20% of correctness in a lot of code.
To illustrate, I cooked up a Java Puzzler-esque Binding puzzle. The application in this post contains a panel with a button on it. It has 2 states. Clicking the button switches to the ‘large’ state, at which point the panel widens and the button’s label changes to “Contract…” instead of “Expand….”
So go ahead and click the button, then see if you can answer this question: Why doesn’t the text change?