Yeah I think you're right.  First of all, in your UIComponent implement a 
measure method and set measuredWidth and measuredHeight to the content 
dimensions of the Loader (this will probably be 0x0 until the content is 
loaded).  Then, watch the loader's events to determine when it is done loading 
its contents.  Once the contents are loaded, call invalidateSize() on the 
UIComponent.  That will force the parent component to re-measure the 
UIComponent and position it accordingly.

Aaron

--- In [email protected], "libbychantel" <libbychan...@...> wrote:
>
> Hello all,
> 
> I am constructing an image from some swfs at run time, I do this by creating 
> a UIComponent and adding the swfs to it using Loader. When done, I add the 
> UIC to an HBox I have on the screen. No matter what I do with setting x & y, 
> the UIC appears with the top left corner exactly in the center of the HBox. I 
> do not understand what I am doing wrong but I suspect it has to do with Flex 
> not knowing the size of the parent HBox at run time, since it starts out 
> empty. Could you please offer any suggestions or links that could help me to 
> understand what I am not doing right. 
> 
> If I am posting in the wrong group, please let me know and accept my 
> apologies for wasting your time. 
> 
> Thank you so much,
> Libby
>


Reply via email to