Reputation: 273432
Flex newbie question: can MXML be generated on the fly, like HTML is generated by a server?
If yes, is it ok to do so or am I missing an important Flex architectural principle.
Upvotes: 3
Views: 719
Reputation: 39916
There is IIS/Apache component given by adobe that can generate your mxml -> html+swf using on the fly compilation, and it also caches the last compiled file.
However its not recommended for bigger projects as it has certain problems that you cant make libraries of your code and organize code accordingly. Namespace usage is very limited.
Upvotes: 3
Reputation: 6034
It is not officially supported but there is a few similar projects doing stuff similar to this.
Should be more as I remember, but can't find it out at this moment... Searching for "MXML runtime dynamic compilation" or something like that should be helpful...
Upvotes: 1
Reputation: 95449
Sort of... but it still needs to be compiled. MXML is not rendered directly, it is first compiled into ActionScript 3.0, and then into a typical SWF... so, you cannot serve your users with MXML. However, like almost all programmming languages, you can use automatic code generation to ease development tasks.
Upvotes: 3
Reputation: 17041
MXML is just a way of describing user interface layout and scripts. This information is then "compiled" into ActionScript, then converted to SWF format for use in the Flash player.
So, yes, you can generate MXML on the fly, in that you can create a text file that contains valid MXML syntax, then use mxmlc to compile it, but there's no way (that I'm aware of) to create MXML and "add" it to your current movie such that the information appears as it would were it compiled.
Upvotes: 1