royale-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <>
Subject Re: Declarations Objects not defined on initComplete
Date Mon, 07 May 2018 05:29:48 GMT
Hi Doug,

I think it has been solved, so I need to see some source MXML and the JS output to understand
why it isn't working for you.  We want to make some parts of the lifecycle similar enough
to not require major refactoring of code.


´╗┐On 5/6/18, 8:29 PM, "doug777" <> wrote:

    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
    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?
    Sent from:

View raw message