[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Flash Movie in HTML Table

Posted on 2005-04-19
16
Medium Priority
?
255 Views
Last Modified: 2010-04-03
I have a nested html table in which I want to add a flash movie into one of the table elements.  I want the flash movie to be a percentage (100% of the table width) so that it can expand/contract yet keep it's aspect ratio.  The problems that I have been having are as follows:  When I change the objec tnad embed tags from the pixel format (800x250) the a percentage (100% x 100%) inside the table I don't see the movie at all.  When I take the movie outside of the table and change the tags to percent I get a lot of white space above and below the movie.  The only way that it will display in the table is when I have it in pixel mode (800x250).  I want to get this flash movie embedded in the html table so that it expands and contracts and keeps its aspect ratio.  The page I am working on is http://www.kachele.com/home.php

Thanks,
John
0
Comment
Question by:Kachele
  • 9
  • 7
16 Comments
 
LVL 18

Expert Comment

by:Billystyx
ID: 13815866
USE SCALE=EXACTFIT


Billystyx
0
 

Author Comment

by:Kachele
ID: 13816051
still doesn't seem to work.  Here's the code I have for the flash:

<table align="center" valign="top" width="90%" style="border-left: #000066 3px solid;border-right: #000066 3px solid; border-bottom: #000066 3px solid;border-top: #000066 3px solid" cellspacing="0" cellpadding="10">
    <tr>
      <td>
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
           <td align="center">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="800" height="250">
<PARAM NAME="SCALE" value="exactfit">
<param name="movie" value="flash/kachele_header.swf">
<param name="quality" value="high"><param name="wmode" value="transparent">
<embed src="flash/kachele_header.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="800" height="250" SCALE="EXACTFIT"></embed></object>
                  </td>
              </tr>
          </table>
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13816296
also just change the width to 100% - leave the height as it is.

Billystyx
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 18

Expert Comment

by:Billystyx
ID: 13816392
I will check rest tonight - I have samples at home and can never remember this stuff off the top of my head:)
0
 

Author Comment

by:Kachele
ID: 13816447
Alright, that is just about perfect but I was hoping to keep the aspect ratio.  When I resize the movie now it stretches the width keept eh height constant and thus changes the aspect ratio.  Is there anyway to keep the aspect ratio?

Thanks,
John  
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13816642
yes, set it back to noscale or noborder.

Billystyx

0
 

Author Comment

by:Kachele
ID: 13817095
Setting the scale to noborder works a lot better but now when the browser resolution is too large it cuts off the top and bottom of the flash movie.  This is because the width is still set to 250.  When I change this to 100% it doesn't display.  Here's the new code:

<table align="center" valign="top" width="90%" style="border-left: #000066 3px solid;border-right: #000066 3px solid; border-bottom: #000066 3px solid;border-top: #000066 3px solid" cellspacing="0" cellpadding="10">
    <tr>
      <td>
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>                        
                  <td align="center">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="100%" height="250">
<PARAM NAME="SCALE" value="noborder">
<param name="movie" value="flash/kachele_header.swf">
<param name="quality" value="high"><param name="wmode" value="transparent">
<embed src="flash/kachele_header.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer"  type="application/x-shockwave-flash" width="100%" height="250" SCALE="noborder"></embed></object>
          </td>
         </tr>
       </table>
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13817854
this will fit it inside the table without stretching it:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Billystyx</title>
<SCRIPT LANGUAGE="JavaScript">
function openWin(URL, windowName, intWidth,intHeight) {
var xVal = screen.availWidth;
var yVal = screen.availHeight;
var x = (xVal-intWidth)/2;
var y = (yVal-intHeight)/2;
strOptions = "width=" + intWidth + ",height=" + intHeight + ",menubars=No,toolbar=No,location=No,scrollbars=No,status=No,resizable=Yes,fullscreen=no,left=" + x + ",top=" + y;
     newWindow = window.open(URL,windowName, strOptions);
}
</SCRIPT>
</head>
<body bgcolor="#999999">
<table align="center" valign="top" width="90%" style="border-left: #000066 3px solid;border-right: #000066 3px solid; border-bottom: #000066 3px solid;border-top: #000066 3px solid" cellspacing="0" cellpadding="10">
    <tr>
      <td>
         <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
     <tr>                    
                  <td align="center" width="100%">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="100%" height="250">
<param name="movie" value="flash/kachele_header.swf">
<param name="quality" value="high"><param name="wmode" value="transparent">
<embed src="flash/kachele_header.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer"  type="application/x-shockwave-flash" width="100%" height="250"></embed></object>
          </td>
         </tr>
       </table>
</body>
</html>

Basdically, you just gfet rid of the scale parameter:)

Billystyx
0
 

Author Comment

by:Kachele
ID: 13824745
Alright, Now it scales down properly but it doesn't scale up.  Once it hits 800x250 it stops scaling.
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13825654
can you post the swf and I will take a look?

Billystyx
0
 

Author Comment

by:Kachele
ID: 13825959
how do I post the swf?
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13826152
If you have space to post then upload it. Otherwise you can email me (my email is in my profile),and I will share the results here. It is advisable to get some web space for storage though - helps a lot with this site for troubleshooting.
I think it isn't to do with the swf, but it helps to have the exact file dimesions etc without having to create my own for testing purposes.

Billystyx
0
 

Author Comment

by:Kachele
ID: 13826627
I placed a link to the swf file at http://www.kachele.com/here.html

Right click on the link ans "Save target As..."

I didn't realize that this is so difficult and have raised the point value by 100 pts.
Thanks,
John
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13829431
how about this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>">
<html xmlns="<http://www.w3.org/1999/xhtml>" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body bgcolor="#999999">
<table align="center" valign="top" width="100%" height="100%" style="border-left: #000066 3px solid;border-right: #000066 3px solid; border-bottom: #000066 3px solid;border-top: #000066 3px solid" cellspacing="0" cellpadding="10">
<tr>
<td align="center" width="100%">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 <http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab>" width="100%" height="250">
<param name="scale" value="noborder">
<param name="movie" value="kachele_header.swf">
<param name="quality" value="high"><param name="wmode" value="transparent">
<embed src="kachele_header.swf" quality="high" wmode="transparent" pluginspage="<http://www.macromedia.com/go/getflashplayer>" type="application/x-shockwave-flash" width="100%" height="100%" scale="noborder"></embed></object>
</td>
</tr>
</table>
</body>
</html>

It looks ok from here...
Billystyx
0
 

Author Comment

by:Kachele
ID: 13832510
Alright, what the movie is doing is the width is scaling down only but the height is not and once the width hits its original size (800px) it stops scaling.  What I was needed to happen is when the width scales the height scales with the same factor.   I was thinking about runnning some kind of script that determines the screen width/height and scales from that.

JK
0
 
LVL 18

Accepted Solution

by:
Billystyx earned 900 total points
ID: 13839103
OK this works with js but doesn't use a table - if this is a problem let me know...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>">
<html xmlns="<http://www.w3.org/1999/xhtml>" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<SCRIPT LANGUAGE="JavaScript">
function openWin(){
var xVal = screen.availWidth;
var yVal = screen.availHeight;
var newid=xVal/850;
var newheight=newid*250;

HTMLstring ='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 <http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab>" width="'+xVal+'" height="'+newheight+'">\n';
HTMLstring+='<param name="scale" value="noborder">\n';
HTMLstring+='<param name="movie" value="kachele_header.swf">\n';
HTMLstring+='<param name="quality" value="high"><param name="wmode" value="transparent">\n';
HTMLstring+='<embed src="kachele_header.swf" quality="high" wmode="transparent" pluginspage="<http://www.macromedia.com/go/getflashplayer>" type="application/x-shockwave-flash" width="'+xVal+'" height="'+newheight+'" scale="noborder"></embed></object>\n';

document.write(HTMLstring);
}

</SCRIPT>
<body onload="openWin();">
</body>
</html>

(and make sure you reformat it so each htmlstring line starts with the variable)
Billystyx
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
Suggested Courses
Course of the Month18 days, 6 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question