views:

222

answers:

1

I've been writing in actionscript 3 using flex builder 3 for a couple of weeks now and never encountered the need to use anything like MXML. I code all layout and design in pure actionscript.

I am not sure why, but many people immediately expect me to have written a lot of MXML when I say that I'm using flex builder.

Is MXML really recommended? If so, why did I never encounter the need for it yet?

+3  A: 

As MXML is compiled to ActionScript while building, there may be no need for MXML - everything can be coded in AS3.

However, I find that MXML is quicker to use in some scenarios - for example, composite components of the UI in an application.

If a composite component is a library-type component (a new type of generic widget - whether based on an existing control or completely custom), I use AS3 as I get finer control. The code for such controls will not change much over time, once a stable release is made.

If a composite component is a part of an application's UI which is more likely to change over time due to user-driven changes to the UI (e.g. application configuration panels) then MXML allows faster iterative development. This is the kind of change where you have to move controls around, change styling etc. in response to user or marketing feedback, or business-driven changes over time.

Vinay Sajip