Hi Doug,
In theory, in MXML Components, the UI children of a tag should be instantiated
after all of the other properties, including fx:Declarations, for that tag.
Suppose you have:
----Foo.mxml----
<SomeTag attr1="foo">
<fx:Declarations>
<SomeDecl id="bar">
</fx:Declarations>
<Child1 id="child1" />
<Child2 id="child2" />
</SomeTag>
In the output JS, the data array passed to generateMXMLProperties at
constructor time should only contain foo and bar. The child1 and child2 data
should be in MXMLDescriptor. At runtime, foo and bar should be set before
Child1 and Child2 get instantiated. The change I made was that Application did
not let you specify child tags. Instead you specify the value of "initialView"
like below:
<Application width="100">
<fx:Declarations>
<SomeDecl id="decl">
</fx:Declarations>
<initialView>
<MyInitialView />
</initialView>
</Application>
Before the change MyInitialView was being instantiated before SomeDecl. Now
that should not be the case, and the children of MyInitialView should not be
instantiated until after SomeDecl.
There could certainly be a bug still, so see if the output matches up with this
explanation.
Thanks
-Alex
On 5/3/18, 7:41 PM, "doug777" <[email protected]> wrote:
Hi Alex,
Sorry to say there's another problem.
Now that Main builds before any of its children build that's great, but it
pushes the same problem to each Child beneath it.
Let's say Child1 is a child of Main and in Child1, Child1a is defined in the
mxml of Child1, then Child1a now builds completely before the rest of Child1
builds.
But in the script of Child1, I pass data to Child1a. When Child1a builds it
says the data from Child1 is undefined.
So just as with Main, each Child in turn must build completely before any of
its children are built.
I hope that makes sense.
Doug
--
Sent from:
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-royale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C76b082f40ae847120fb808d5b1687afe%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636609984666887029&sdata=7WqGHjVig%2BmJ82CxHZX3pOz0UdHRXVGE5wPnnmzwcIc%3D&reserved=0