Hi Alex,

In the children of Main (the Views), Declarations are not instantiated
before the rest of the page, so they are all undefined when required. (The
problem is fixed in Main itself - the items in its Declarations are all
defined correctly.)

In the meantime I have been clearing up all the other undefined variables
errors.

As far as I can see what happens when you run a js project in the browser is
first a kind of build process takes place that finds all the variables in
each mxml file and then steps through init() (if there is one) for each
child and follows the code in there. This phase if it occurred in a flex swf
project was completely transparent so I never knew it existed.

But there is a big problem with this. If the project uses asynchronous
processes such as remoteObject, all the variables that depend on the results
of these are undefined, since the build process punches blindly through the
code without waiting for anything. It was not previously a problem as this
code was apparently never reached until after the resultHandler event
occurred. They're not difficult to fix, it's just finding them all that
takes a long time, but all done now.

Do you think the Declarations in children problem can be resolved or it
would be better for me to define these objects another way?

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Reply via email to