在客户端进行MXML解析.
This is a sample of client side MXML rendering. the engine loads the maine movie which contains the parser which loads the mxml file. I added an attribute ''assets'' to the application node which specifies a swf that contains all the components. This allows u to only add the components you need. On loading it will parse your xml (similar to mxml but different due to client side processing and anot having the same classes flex uses). Right now its proof of concept.
Basically what it does is reads the node names of the XML nodes and instanciates the component or the non UI class. it transfers the attributes i.e styles/properties/setters after the component has loaded (it auto detects so if your component supports the v2 architecture i.e. inherits from UIComponent) and then loads the next... It doesnt support nesting cause i havent made the classes to emulate HBox, VBox, ScrollPane etc.. I''m trying to make it so that the engine doesnt know anything bout the components besdies them inheriting from UIComponent and support v2 architecture.... so these containers classes would need to be created or wrappers made for MM''s.
No source available since it was a study to see how flex could be made on the client side and from what i see it is very, very, doable. The code i wrote supports the {rf} in attributes to evaluate the variable, supports events and defining AS in those events like ''click="a=3"'' for a button, supports arrays in arrtibutes like setSize="[20,40]" etc. Take a look at the XML to see what i''ve managed to make it do HERE
Thanks to Enclosure for his amazing AS interpreter which makes interpreting of AS code in attributes and the script tag possible
Sample Movie (XML is HERE)