1 person found this helpful
To me, this is exactly what mxml is all about: writing code in xml.
You are comparing import statetement and taking a namespace in to use in mxml tag, but they are the same thing. import statement takes a namespace in to use.
For the question which one is better, I don't think that there's a clear answer. In my opinion using only xml tags in mxml components is more readable compared to using the script tag, but for some dynamic functionalities you need ActionsScript and the script tag. In many cases it's just a matter of taste.
I think I got it. I am just surprised that there is so little documentation about it; If I had not gone through the code and analyzed it, I would have never thought of using, say a <flx:series> tag, which would be unlikely to show up in any search.
"To me, this is exactly what mxml is all about: writing code in xml" is something I agree with. I guess which one is better is up to the code writer to decide, but being aware of this possibility really helps in grasping the concept of an mxml tag or component being an AS class. Now I realize some things I had never thought of before.
jake_flex, thanks for enlightening me.
You're welcome Carlos.
One more thing. Previously I said it's a matter of taste, which is true, but there are of course preferences. mxml is for mainly static stuff like creating the UI and ActionsScript for the more dynamic stuff and operations behind.
Creating an UI with ActionsScript only requires a lot of code as is messy compared to mxml.
Hi jake flex,
I can't agree with your statement that creating with pure AS3 is messy, or requires more code, in fact is quite opposite, and because you can't see the code behind fascade of XML tags it doesn't mean it is not there,
I can create a button and put it on stage with fair amount of code then export SWF (using AS3 only) and I can do the same with flex which SWF will be larger?
problem is when I want to create more complex functionalities taht flex already have for you then I have to create more code, but that's OK as always I can use some framework or try to create my own, trimmed to fit my needs (without bulk of not used code).