If you load the SWF into a wrapper swf, you can just use loaderInfo to get the 
dimensions.  I think you can then use ExternalInterface to resize the swfObject.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of Aran Rhee
Sent: Tuesday, September 29, 2009 3:56 PM
To: [email protected]
Subject: Re: How to embed swf with it's original, unknown size?

Chris.

If you don;t know the dimensions of the swfs beforehand, then there is no way 
on the client-side from the page to get the dimensions. You will either need to 
use server side tools:

PHP:
http://www.webmaster-talk.com/php-forum/160440-simple-php-to-find-swf-dimensions.html

ASP:
http://www.4guysfromrolla.com/webtech/tips/t102001-1.shtml

Or call a util on the server like:
http://www.swftools.org/swfdump.html


The other way would be to load the swf into a wrapper swf and get it's 
dimensions using a class like SWFReader:
http://www.senocular.com/index.php?id=2.43
http://www.senocular.com/flash/actionscript.php?file=ActionScript_3.0/com/senocular/utils/SWFReader.as


So there you go, many options for you to choose from...


Aran





On Wed, Sep 30, 2009 at 7:15 AM, chris27 
<[email protected]<mailto:[email protected]>> wrote:

Did you get a solution for this?  I'm having exactly the same
problem!  Been tearing my hair out - I can't believe there is no
simple solution to this.   I don't know what dimensions each SWF will
be, and I don't have any control over the Actionscript code.  I have a
container div and I'm adding the SWF to this using SWFObject 2.0. If I
use '100%' for the width and height properties, the SWF doesn't
display at all, as its containing div has no width or height set in
the CSS.

WHY CAN'T FLASH HANDLE THIS???  I don't want a re-sizable SWF, I just
want my containing HTML element to expand to the width and height of
each SWF as it was when it was published!  It seems that you can't
dynamically add a SWF to an HTML page without giving it explicit
dimensions, and there is no simple way to find out what they should be
beforehand.

On Aug 29, 11:18 pm, danyalejandro 
<[email protected]<mailto:[email protected]>> wrote:
> Hi
>
> I made an SWF that loads data from a database and dispays the results
> as a vertical list; therefore, the height of the swf varies depending
> on the stored data.
>
> Whitout using SWFObject, I have no problems embedding the SWF. It's
> height varies depending on how much content it's displaying. This is
> my desired behaviour.
>
> When I try to dynamically insert said SWF in my pages with swfobject,
> I can only see it if I specify a fixed height. If I try using
> width="100%", the swf dissapears.
>
> How can I tell SWFObject to use the swf's original height? this is my
> relevant code (all of it is inside the <body>):
>
> <script type="text/javascript">
>         var flashvars = {};
>         var params = {};
>         params.play = "true";
>         params.loop = "false";
>         params.quality = "high";
>         params.wmode = "transparent";
>         params.allowscriptaccess = "sameDomain";
>         var attributes = {};
>         attributes.id<http://attributes.id/> = "MapaEstrategico";
>         attributes.name<http://attributes.name/> = "MapaEstrategico";
>         attributes.align = "middle";
>         swfobject.embedSWF("MapaEstrategico.swf", "mEstrategico", "768",
> "100%", "9.0.28", "expressInstall.swf", flashvars, params,
> attributes);
> </script>
>
> (...)
>
> <div id="mEstrategico" style="width: 764px; margin: 1px auto;"
> align="center"></div>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to