I'm currently doing a couple of freelance projects during the summer and one of them includes working with Flex. I've done a lot of Actionscript 3 and feel confident enough to work with it so I've just started to learn Flex 3 (thank god for lynda.com). But I don't like the fact that I have to write the Actionscript code in the mxml file. There has to be a better way right?
Does anyone know some best practices for Flex 3?













Comments
Pfff...sound pretty hard to me ;)
I think im gonna learn some programming too during the summerbreak...
Your code should be written in AS files, that call MXML objects. I don't know exactly how you glue it, but I guess you just instantiate it from AS.
Beautiful template!
You don't have to only use script blocks in you MXML. I generally use the "code behind" method which allows you to separate your AS and MXML completely. Basically you just extend any of the built in classes. Here are some links for reference.
http://www.onflex.org/ted/2007/02/code-behind-in-flex-2.php
http://thecomcor.blogspot.com/2008/06/flex-code-behind-pattern.html
Woa thanks a lot Brian, it really helps out a lot!