>  I thought you said MXML shouldn't be used to create javascript.  

I don't have a clear recollection. I was probably recommending that MXML be 
converted into a data structure or a bytestream that would get interpreted by a 
small bit of JavaScript (or any other language). This is what Alex has been 
recommending, rather than turning MXML into JavaScript source code. (It's 
conceptually similar to the old approach of generating UIComponentDescriptors 
in early version of Flex, which could then be instantiated into actualy 
component instances.) But if you prefer to turn MXML into JavaScirpt source 
code, it should be straightforward to do that. The MXMLClassDirectiveProcessor 
is a simple recursive descent through the MXML AST. The main complexity is that 
it can't simply generate a continuous stream of code in tree order. For 
example, an attribute value that is a databinding expression has to generate 
all sorts of extra stuff like Watcher instances in other places.

- Gordon

-----Original Message-----
From: Michael Schmalle [mailto:apa...@teotigraphix.com] 
Sent: Friday, January 18, 2013 10:27 AM
To: dev@flex.apache.org
Subject: RE: [FalconJx] where I'm going to be


Quoting Gordon Smith <gosm...@adobe.com>:

>> There needs to be an intermediate "model" that can hold the MXML data 
>> structure AFTER the AST. (I guess)
>
> I don't see why you would need to transform the MXML AST into yet 
> another model. There are already two models for MXML and they should 
> be sufficient.
>
> The syntactic model produced from the MXML tokens is MXMLData. Like 
> any XML DOM, it simply represents the nesting of the tags, their 
> attributes, and the text inside, without attributing any meaning to 
> anything.
>
> The semantic model for MXML is the MXML AST, which has determined what 
> every tag, attribute, and piece of text means. For example, it has 
> understood that when you write <s:Button label="OK" color="red"
> click="doit()"/> you are creating an instance of 
> spark.components.Button, setting the label property to "OK", setting 
> the color style to 0xFF0000, and adding an event handler to handler 
> the click event. The MXML tree captures every piece of semantic 
> information that was in the MXML file.
>
> - Gordon
>

Gordon, this conversation is getting really diluted but I agree entirely that 
the model existing is great and will work.

I misunderstood something you said a while back in a conversation with Alex. I 
thought you said MXML shouldn't be used to create javascript.  
Maybe you meant using it to mimic views or something? Can you elaborate, do you 
remember.

Mike


--
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com

Reply via email to