Idealism is what precedes experience; cynicism is what follows...

Saturday, June 14, 2008

Adobe Flex : Event/Action binding in MXML and AS

Try to avoid mixing and matching MXML and ActionScript event/action binding. This is also more of a recommendation then a requirement. If you start binding the creationComplete or click events in MXML try to bind them all in MXML. If you bind your events in ActionScript try to bind all of them in ActionScript. Once you start mixing and matching it can be hard to track down code flow later on. You may find yourself wondering why an event keeps triggering because you left it in MXML and forgot about it. In my above example I bind the click event. You can easily do this in the initilize() method using addEventListener(). Use what works best for you.

No comments:

Blog Archive

My Network