Code-Behind with Flex2
Just recently, I worked on a rather large Flex2 project that went at a rather fast pace to say the least. One of the techniques that I started using were creating “code behinds” for mxml components, and man what a help that was😉 In looking back, I can’t really think of doing it any other way now. It was a much more oop way to approach component development in that I could reuse base classes for other versions of the component etc – just made it much cleaner and manageable!
Then I saw Ted’s post on it today;) It’s a great resource for getting started with this technique.
The one thing I found funny with the code behinds is the public declaration of components you’d access in MXML – that’s really the only quirk to using the code behind method (thanks to Aral for pointing that out in his white paper comments – LOL, without that little comment in the code, I’d have had no clue why mine wasn’t working)