views:

87

answers:

1

Hi,

I want to get the dimensions of a dynamically loaded flash object and resize a DIV accordingly to it. I can't use a server side language to do it.

I've tried searching about loading and reading the header portion of a SWF file to get it's dimensions with javascript but came up empty.

Is this remotely possible/feasible?

Thanks in advance, J

+1  A: 

As stated in the discussion here, you need to create another swf (call it A) that loads the swf you want to embed (call it B), and read the dimension of B using A's Loader's contentLoaderInfo to get the width and height of B. Finally tell the value to JS using A's ExternalInterface.

Andy Li