>That said, based on the code snippets provided, I'm not sure why 
>"initComplete" fired before addElement, which is what I think you are trying 
>to point out.  I would expect it to be called in addElement, so further 
>investigation is needed there.  Put a breakpoint in your "initComplete" 
>handler and see what the call stack is.  addedToParent() should be on the call 
>stack.

    Correct I wasn't being clear enough.  Yes the "initComplete" was firing 
before the addElement from our original problem.  After setting up a new test 
application I couldn't produce it again.  Manually deleted the debug folder of 
the other test app and rebuilt it, it was working fine.  I think that quick 
compile/debug combo leaves debris sometimes.   I checked the call stack anyways 
for the event handler "initComplete" and it  had addedToParent in it.   So well 
just blame the bin/output and the guy failing to manually cleaning it out (me) 
.  


Thank you for taking the time to respond.  Sorry for the confusion.


-Mark K

-----Original Message-----
From: Alex Harui [mailto:aha...@adobe.com.INVALID] 
Sent: Monday, April 1, 2019 12:29 PM
To: dev@royale.apache.org
Subject: [Non-DoD Source] Re: CreationComplete event question

I haven't really followed this thread in detail so apologies if I'm missing the 
point.

Hopefully, FlexJS/Royale has never promised 100% backward compatibility with 
Flex.  That's because there are some fundamental differences in the 
runtimes/platforms.  In Flash, if you change properties of a DisplayObject, the 
effects show up after all other code runs.  In the browser, if you change 
properties on an HTMLElement, it shows up right away in many cases.  So 
lifecycle events and invalidation are not being promised to work exactly as 
they did in Flex.  It would add a lot of overhead to try to emulate the 
deferred rendering of Flash in the browser.

"initComplete" in Royale isn't quite the exact same as "creationComplete" in 
Flex.  Both give you a place to run some code as the component is initialized, 
but there may be subtle differences if you depended on deferred validation in 
Flex.

That said, based on the code snippets provided, I'm not sure why "initComplete" 
fired before addElement, which is what I think you are trying to point out.  I 
would expect it to be called in addElement, so further investigation is needed 
there.  Put a breakpoint in your "initComplete" handler and see what the call 
stack is.  addedToParent() should be on the call stack.

HTH,
-Alex

Reply via email to