Hi Doug,

Even in Flex, MXML is converted to ActionScript.  The order that code is run 
has to do with when certain events are dispatched.  Same should be true in the 
browser, but there are fewer lifecycle events.

Depending on a ViewStack or Spark Navigator's creationPolicy, non-selected 
views do not go through the full instantiation lifecycle.  In Royale, 
visible=false just hides something, but it still goes through and calls its 
initComplete.   Is that what is running your code too soon?  I'm trying to 
understand how View2 calls the actionscript support class in both the Flex 
version and the Royale version.

Thanks,
-Alex

On 4/29/18, 9:37 PM, "doug777" <[email protected]> wrote:

    The old Flex project used a ViewStack (and Spark Navigator) for the Body
    Views. I have changed this to use visible = false in the mxml and then
    switch visible on and off whenever the user wants to change the View.
    
    The call stack is creating the items in the order of the mxml in Main - so
    it goes Application... - View... - Container... - Container... - View1... -
    View2 - Add View2 as Child and then stops on the actionScript line in this
    support class.
    
    But I'm wondering how the javascript interpreter in the browser knows which
    was mxml code and which was actionScript. So isn't it quite reasonable that
    an actionScript line might get looked at before initComplete is called?
    
    So the question really is how does one get the mxml code to build and then
    call initComplete before any of the actionscript is inspected?
    
    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%7C4defe2481d8e41851f9c08d5ae540263%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636606598203970349&sdata=m3uOX4vrVHec%2Fx%2BbbV2dVBY0ZouWVqnO78mKFdtXI0M%3D&reserved=0
    

Reply via email to