2

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>
1
  • 2
    Your title is misleading Commented Mar 30, 2012 at 18:01

4 Answers 4

3

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>
Sign up to request clarification or add additional context in comments.

Comments

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

Comments

0

Here is a short and to the point tut about embedding swf in html:

http://www.tizag.com/flashTutorial/flashhtmlcode.php

2 Comments

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)
As Starx said in his answer. Do you have also set width, height in the object tag?
0

Use CSS to increase the page width and height of your body and html tags

<style type="text/css">
html,body {
    height:100%;
    width:100%;
}

body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
</style>

I had a similar issue with a full page flash file, where firefox wouldn't display the flash and chrome displayed it with a limited height towards the top of the page.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.