Load the UI earlier but set the visible and includeInLayout properties to the component to false.
Then in the function call that used to load the UI, just set those properties to true.
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
Flex / AIR Development, Training, and Support Services
So order of operations question on that. I build the UI elements in the on initialization function for the component and then display it with another function call. Basically I have the UI designed in MXML and then assign it as a child to a new Panel() object created in the init' function. This is then displayed using the mx.managers.PopUpManager.addPopUp() function called from a publicly declared function in the component. For the life of me I can not think why the display function works without any problems but the secondary function (a data filter-function) only works after the UI has been displayed.
Nothing in the filter funciton references any of the UI elements directly. But what would be the order of precdence for initilizing the UI before hand? Would I add that code to the initialize function or creationComplete?
So I went ahead and added the code to display the UI to the creationComplete function. If the UI is displayed and the user closes it, the subsequent call to the filter function works. However, if I close it in code, it fails.
Note that the failure is that it does nothing. There is no error message and any alerts I put in the function are not triggered.
I feel grey hairs comming on from this...