DISQUS

Vivisecting Media Conversations: The Flex Code-Behind Pattern

  • webnesto · 1 year ago
    Having worked with James on a project that implemented this pattern, I can heartily agree with his recommendations and personally attest to the value in this structure.

    For people new to this concept, I always refer them to how we *try* to create unobtrusive javascript in a traditional HTML/JS environment.
  • Brent · 1 year ago
    Excellent article. Tried this pattern a couple of times (using some code from the Ted-On-Flex blog - http://www.onflex.org/ted/2007/02/code-behind-i...), but have always found several pitfalls. This seems to clarify a number of my questions. Thanks!
  • James · 1 year ago
    I am glad this helped clear up some of the pitfalls. When we first adopted this pattern on the project Webnesto is referring to in his comment, we would definitely had some challenges with the initial implementation. I have a feeling I missed a few other less common pitfalls we stumbled upon during the that project and other ones I have have used it on. At this point it has become more second nature, so what was once an "workaround" is now just how I code. If you, or anyone else, has some issues or questions about the pattern please let me know and I will reply and/or update the post with recommendations.
  • Rafael Santos · 1 year ago
    Fantastic article..... Good straight forward information.... Direct and compact....
    It helped me understand more about how Flex/AS works and how this interaction should be handled....
    Thanks
  • Emre Selen · 1 year ago
    That was just the case I was wondering about. Thanks a lot. Nice and simple. Just on point.
  • artigat1 · 4 months ago
    I like the idea of this code behind a lot. One problem I seem to be having though is creating a new instance of an object in actionscript code and then trying to set elements within the mxml for that object.

    It seems that I need to add the object before I can change any of the elements or properties. Is that correct? The project I'm working on requires a number of objects to be set in memory ready to be added when required. This might include setting the text of a label, but also it's position or styles or any number of other things.

    I've tried moving the super.initialize() into the constructor, but that doesn't seem to work. Have you encountered this problem before?