How to get the size of a dynamically loaded swf with javascript?
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 ge开发者_如何学Pythont it's dimensions with javascript but came up empty.
Is this remotely possible/feasible?
Thanks in advance, J
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
.
精彩评论