Embedding .swf files on an .html page

16,821

Solution 1

You also need to provide the height and width for the Object as well.

<object width="100%" height="100%">
    <param name="movie" value="file.swf">
    ..
    <embed src="intro.swf" width="100%" height="100%" />
</object>

Solution 2

Seems like an inactive post but just in case someone looking for a solution stumbles upon this, here is the solution:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
    codebase="http://download.macromedia.com/pub/shockwave/
    cabs/flash/swflash.cab#version=6,0,40,0" 
    width=100% height=100% id="intro"> 

  <param name="movie" value="sample.swf" /> 

  <param name="quality" value="high" /> 

  <param name="bgcolor" value="#1C140D" /> 

  <embed src="/path/to/sample.swf" quality="high" bgcolor="#1C140D"
      width=100% height=100% name="intro" align="" 
      type="application/x-shockwave-flash" 
      pluginspage="http://www.macromedia.com/go/getflashplayer"> 
  </embed> 

</object>

Note:

  1. Don't define the width and height parameters in double quotes (when using %)
  2. This technique will not work for XHTML, <embed> can't be within <object> tag
Share:
16,821
Lily Evans
Author by

Lily Evans

Updated on June 15, 2022

Comments

  • Lily Evans
    Lily Evans almost 2 years

    I've built an intro page for my website (it's a .swf file) and I'm trying to embed it into an .html file, but the html code won't allow me to resize the file (I want the file to take up the whole page, so I tried resetting the height and width parts of the object tag to 100% - it didn't work) someone told me that the best way to resize the file would be by using javascript. How would I do this?

    the code is as follows:

    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="400" id="intro to elianas website" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="intro.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#1C140D" />
    <embed src="intro.swf" quality="high" bgcolor="#1C140D" width="100%" height="100%" name="intro" align="center" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    
  • Lily Evans
    Lily Evans about 12 years
    I know how to embed a file... I want to know how to resize the file so that it fills the page (but I want to do it so that the size depends on screen size/web browser - if it were any other html object, I'd use percentage over pixels, but in this case, it doesn't seem to be working for me)
  • Sven Bieder
    Sven Bieder about 12 years
    As Starx said in his answer. Do you have also set width, height in the object tag?