Hi Alex,
I am still trying to work out what is happening, but I'm almost certain the
problem is nothing to do with any problem with fx:Declarations.
Instead the problem occurs because the order in which JS builds things is
totally different than Flex Spark/MX.
I have not changed the basic structure of the old project, only converted
items from old Flex to something that is available in JS.
So the structure of Main.mxml is something like this :
js:Application .... applicationComplete="init()"
fx:Declarations
fx:Style
js:beads
js:valuesImpl
js:initialView
js:View
<js:VContainer
!--Header--
js:HContainer
!--Body--
js:Container
View1
View2
....
View13
!--Footer--
js:Container
fx:Script
....
function init()
etc.
The problem is not that init is not being called by applicationComplete, the
problem is that it looks like the entirety of the Views in the Body are set
up before Main.init() is called.
The first failure is on an <b>actionScript line* in a support class used
by all the Views, but stepping through the debugger it occurs immediately
after View2.mxml is added as a Child (even though it is also used in Main
and View1). It fails because the line is looking for something that is set
up in Main.init(). But Main.init() has still not been called.
This support class is not mentioned in any of the mxml as far as I can see,
so I can't understand why it is being looked at at this point in the process
unless there is no connection between the order items appear in the debugger
and various threads are running and appear out of sequence.
If this is true then the first time this support class is called is in the
result handler of a RemoteObject defined in js:Beads in Main.mxml.
It looks as though the structure of a JS project has to be very different
than a Flex project but I cannot immediately see how to get the project to
build in a logical order if even the actionScript lines are built before
applicationComplete is called.
Doug
--
Sent from: http://apache-royale-users.20374.n8.nabble.com/