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)
    {
       IContainer(parent).childrenAdded();
    }
}


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
proceeding.

That do you think?

‹peter

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

>
>
>On 5/18/15, 1:51 PM, "Peter Ent" <p...@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
>something.
>-Alex
>

Reply via email to