tags:

views:

326

answers:

1

This is a long shot as I don't think it's possible.

I want to load in a SWF and set it to fit in the window, whilst keeping it's aspect ratio.

When I do this by setting the height and width of the SWFLoader, the SWF will resize to best fit in the space (as it is keeping it's aspect ratio).

However I can't find a way to detect the height and width of that SWF now it has been resized. The size of the SWFLoader reflects what I set it to, and the SWFLoader.LoaderInfo size seems to be totally random.

I have also tried the loaderInfo.content, but again I don't get a value that compares to the size of the SWF I have loaded (or at lease the size of what is visible).

The only thing I can think to do is to know the height and width before and then figure out the aspect ratio, so if I resize the width to 50% of the window, I can do the maths on the height to make the swf loader the same height as it's scaled content.

Please let me know if you have any suggestions.

Thanks

Rob

A: 

Yup...

Just realised SWFLoader.contentHeight and contentWidth which does exactly that...

robmcm