Assuming you tried to contact me, I did not see anything from you, but in
general asking on this list is best.

On 10/14/14, 12:34 PM, "Neverbirth" <neverbi...@gmail.com> wrote:

>
>   In particular, I want to know when a class can have another class as a
>children. For example <s:Application> may have a <s:Button> as a child.

I’m not sure I understand the question.  Are you trying to determine when
the value of any property can be a non-primitive, or when the default
property value can be a non-primitive, or when the default property value
can be an array of non-primitives?  Or are you only concerned about
display object children?

Gordon or Darrell might be able to explain it better, but here’s my
version:

In MXML, you have a tag and then in some cases you want to specify the
value of certain properties as object instances via sub-tags.  For example
for this class:

public class MyClass
{
   public var someproperty:Object;
   public var someotherproperty:Object;
}

You can declare it in MXML and assign values to properties like this:

<MyClass>
    <someproperty>
        <SomeSubTag />
    </someproperty>
    <someotherproperty>
        <SomeOtherSubTag />
    </someotherproperty>
</MyClass>

The [DefaultProperty] metadata allows you to specify the value of a
property without the property name tags, so by adding
[DefaultProperty(“someotherproperty”)] to MyClass.as, you can then declare
it like this:

<MyClass>
    <someproperty>
        <SomeSubTag />
    </someproperty>
    <SomeOtherSubTag />
</MyClass>

So, fundamentally, the allowed sub-tags of a tag that aren’t wrapped in a
property name tag is completely dependent on whether the default property
allows for non-primitives.  I don’t think we ever do this, but the default
property of some class could be a String or Number.

Most of our default properties, especially for UI “containers” is an
Array.  We have not filled out [ArrayElementType] metadata for FlexJS yet,
but for the Flex SDK, there should be [ArrayElementType] metadata that
dictate what is allowed as the value of a default property of type Array.
And if it is missing, feel free to add it.

I believe there are non-display object tags in Flex like RemoteObject that
take Operations as children, so this protocol isn’t just limited to UI
declarations.

HTH,
-Alex

Reply via email to