Flex SWFs have 2 frames.  The preloader frame's size is based on the 
Application tag.  If you don't set a width/height, you get 500x375.  The 
complete event fires when all the bytes are downloaded but may be handled 
before the Application frame has had a chance to run.  Depending on how the 
Application finally lays out it could take several more frames to decide on its 
final size.  Usually, we recommend catching the complete event then adding a 
listener to swfloader.content for "applicationComplete".  The child app will be 
fully baked by the time you get that event.

--- In [email protected], "rob" <rob_mcmich...@...> wrote:
>
> I have a complete event on two swfLoaders.
> 
> Once both of the swf loaders have dispatched their complete events I call a 
> method to calculate their content's width and height.
> 
> Something like this:
> 
> myWidth = mySwfLoader.contentWidth;
> myWidth += mySwfLoader2.contentWidth;
> 
> I get an intermittent problem where the content width and height are reported 
> incorrectly. If I call the method manually later, from a button, then they 
> always report correctly, even if they have previously reported incorrectly.
> 
> Therefore I have assumed that at the point the complete event dispatched by 
> the SWFLoader, it hasn't calculated it's contents height and width. Sometimes 
> my method must be asking for this value before it's calculated.
> 
> My question is if this is a known problem, and if there is another event I 
> should be waiting for. I don't want to set a time out, to allow for the 
> content height and with to be calculated.
> 
> Please let me know if there is another event dispatched by the SWFLoader, I 
> have tried all the non inherited ones, but with no joy :(
> 
> Thanks
> 
> Rob
>


Reply via email to