Results 1 to 3 of 3

Thread: embedded .swf file rendered too small

  1. #1
    Join Date
    Oct 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default embedded .swf file rendered too small

    I have a .swf file that is going in the web page for the logo. It is supposed to be 610px wide and 81px in height when rendered in the HTML. The actual .swf file, when viewed standalone, appears much larger than that - but I presume I should be able to just set its rendered / desired dimensions when I embed it in the HTML, as usual.

    The odd thing is that the .swf, when embedded and viewed in the web page, is displayed extremely small.

    I have checked my code - the width and height are declared properly.

    I am embedding the .swf using SWFObject, but the same problem occurs if I use the Flash Satay method (alistapart.com article). Here are code snippets showing both versions:

    The SWFObject embedding method:
    Code:
    IN THE HEAD:
    <script type="text/javascript" src="swfobject.js"></script>
    
    IN THE BODY:
    <div id="flash-logo">
     <p>Requires Flash player and Javascript.</p> <!-- shown to browsers without Flash and JS -->
     <script type="text/javascript">
     // <![CDATA[
      var so = new SWFObject( "logo.swf", "logo", "610", "81", "9", "#000000" );
      so.addParam( "wmode", "transparent" );
      so.write( "flash-logo" );
     // ]]>
     </script>
    </div>
    That's just the HTML obviously - the imported JS is the standard SWFObject library.

    And the Satay method to embed:
    Code:
    <div id="flash-logo">
     <object type="application/x-shockwave-flash" style="width:610px; height:81px;" data="logo.swf">
      <param name="movie" value="logo.swf">
      <param name="wmode" value="transparent"><a href="http://www.macromedia.com/go/getflash/">Requires Flash player</a> <!-- shown to browsers without Flash -->
     </object>			
    </div>

    Now both methods work correctly with embedding and resizing other flash content on the same page. So there is something wrong with this particular embedding instance. Furthermore, the problem .swf appears small in all browsers (IE6+, Opera, Firefox, etc).

    I am not at all a Flash pro. This .swf was provided to me by the client. Does the problem as described above sound like it is not a embedding error but is an issue caused by the .swf itself?

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    It sounds like a problem with the .swf itself, in that the size isn't proportional to the 610 x 81 size that you want.

    In an attempt to show the entire flash movie, the flash object is resizing so it's entire height is 81 and then resizes the width accordingly.

    There might be extra space around the flash movie (within the .swf) that is throwing you off.

  3. #3
    Join Date
    Oct 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    @Medyman - Thanks for all the input. As it turns out, after I posted here, I did more testing and turns out it that was exactly the problem -- the .swf provided had loads of extra whitespace around the actual intended content (not being a flash guy, I didn't realize that at first) and as result the file was in fact a larger size than it was supposed to be. I was trying to embed it sized to one set of dimensions, and it wasn't created with those in mind.

    So, the solution was simply to get a new, corrected .swf from the client

    Guess it could have been worse... thx again. All done here

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •