flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Ent <p...@adobe.com>
Subject Re: [FlexJS] Layout Update
Date Tue, 19 May 2015 14:27:53 GMT
I¹ve been looking into this.

In MXMLDataInterpreter.generateMXMLInstances, if the data parameter is
null, the function immediately returns. This means you have something like
<js:Container /> - it has no children.

I¹m wondering if a better approach might be to re-write this function as:

public static function generateMXMLInstances(document:Object,
parent:IParent, data:Array):void
    if (data) generateMXMLArray(document, parent, data);

    // maybe we can remove this.  All IContainers should be IMXMLDocuments?
    if (parent is IContainer)

This way, childrenAdded is called all the time. It would mean that
zero-or-more children were added vs one-or-more children were added. This
would allow things that draw backgrounds to be called in a natural way. It
would also mean that code that is optimized to work for one-or-more
children should first check to see that there are children before

That do you think?


On 5/18/15, 5:11 PM, "Alex Harui" <aharui@adobe.com> wrote:

>On 5/18/15, 1:51 PM, "Peter Ent" <pent@adobe.com> wrote:
>>The container appears to have no size. I have it explict (400x400) and so
>>it should be a colored rectangle. Without content you get a blank screen.
>>Add a label and you get the label inside a 400x400 colored box.
>Ah, ok.  If the container does have size then yes, it should draw

View raw message