How to put transparent swf into html/php? - html

<!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-US" lang="en-US">
<div id="divAnima01">
<object>
<embed src="anima/anima01.swf" width="340" height="590">
<param name="wmode" value="transparent" />
</embed>
</object>
</div>
Everything works except transparency - swf has white background.
I tried to put wmode outside embed tag - without result.

Try it this way:
http://www.verticalmoon.com/tutorials/general/transparency/transparency.htm
In the embed tag, and also the params tag before the embed.

Related

Adjusting width of flash content without changing aspect ratio

I want to maintain width of 600 px and height be adjusted accordingly in order to maintain aspect ratio. How can that be achieved?
I m using following code:
<!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" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myFlashContent", "9.0.0");
</script>
</head>
<body>
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="600" id="myFlashContent">
<param name="movie" value="swffile.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="swffile.swf" width="600">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>

Stretching a video?

I am trying to stretch the video that I have. It has to be 400 X 400 stretched. I tried using the "stretchtofit" value="true" but that doesn't work and I need the video centered under the heading. I'm curious as to what I use to stretch the video? This is my code:
<!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=utf-8" />
<title>Lab 8-3</title>
</head>
<body>
<div style="text-align: center">
<img style="border: 0" src="magiclogo.png" width="325" height="88" alt="Logo" />
</div>
<div style="position: absolute; top: 110px; left: 310px">
<object data="magicshow.wmv" height="400" width="400">
<param name="showcontrols" value="false" />
<param name="stretchtofit" value="true" />
</object>
</div>
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6">
<param name="URL" value="magicmusic.mp3" />
<param name="uimode" value="invisible" />
</object>
</body>
</html>
why aren't you using <video> tag. you can set the size easily.
<video width="400" height="400" controls>
<source src="movie.mp4" type="video/mp4">
</video>

SWF refuses to scale vertically

I'm trying to embed a SWF in a simple HTML page such that it scales to fill the browser window. I didn't create this SWF and lack the tools to edit it, but it's doing something quite odd - it scales to fill the browser horizontally but refuses to scale vertically:
Here's the HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Conforming HTML 4.01 Transitional Template</title>
</head>
<body>
<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="100%" height="100%">
<param name="movie" value="Snow001.swf" />
<param name="quality" value="high" />
<PARAM NAME="SCALE" VALUE="default">
<embed src="Snow001.swf" quality="high" type="application/x-shockwave-flash" width="100%" height="100%" SCALE="default" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
I've been staring at this HTML for far too long now and I can't see anything wrong with it. Is this a problem with my code or with the SWF itself? If it's a problem with the SWF what do I need to have the Flash guys do to fix this?
Try adding this CSS:
html, body, object { height: 100%; }

iframe tag blocking other contents of the page

I am a beginner in html. I have a web page containing an iframe tag.
If the tag is closed like
<iframe src="http://mysite.com/l/5042/2012-06-21/9pb4y" width="100%" height="500" frameborder="0" style="border: 0" />
the html content following iframe tag are not displayed.
But if the tag is closed like
<iframe src="http://mysite.com/l/5042/2012-06-21/9pb4y" width="100%" height="500" frameborder="0" style="border: 0" > </iframe>
everything works fine.
Don't know why I am having this weird issue.
Copy this code to the W3C markup validation service:
<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> //-->
<!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">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<title></title>
</head>
<body>
<iframe src="http://mysite.com/l/5042//2012-06-21/9pb4y" width="100%" height="500" frameborder="0" style="border: 0" ></iframe>
<iframe src="http://mysite.com/l/5042//2012-06-21/9pb4y" width="100%" height="500" frameborder="0" style="border: 0" />
</body>
</html>
Comment and uncomment as appropriate to test the two different DOCTYPEs.
You will see that the iframe tag is not supported with your DOCTYPE. Either change the DOCTYPE or don't use iframes. (Of course, you can use the iframe tag that is explicitly closed, but since that does not validate, I would say that is a risky option if you want to work in as many browsers as possible.)
I don't mean to imply that iframe is deprecated. See this unchallenged posting on the W3C site
A iframe is tagged like the one that works in your example
<iframe src=... attributes=...></iframe>
But in your example is a space between open and close tag, just remove that.

swf(flash) plays automatically in chrome

I embed the swf file by swfobject. I do not want the swf file(it's an advertisement) play automatically, so I set the attribute of play with "false". as following html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject/swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myFlashContent", "9.0.0", "expressInstall.swf");
</script>
</head>
<body>
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="970" height="250" id="myFlashContent">
<param name="movie" value="day_110702/ad.swf" />
<param name="play" value="false" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="day_110702/ad.swf" width="970" height="250">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>
It works perfectly on IE but it doesn't work on Chrome/Firefox. In Chrome/Firefox the swf file plays automatically.
In addition, another behavior of swf file differ from Chrome/Firefox and IE is:
when you embedded the swf file with invisible iframe tag. as
<iframe id="iframe" src="swf.html" style="width:100%;height:100%; display:none; visibility:hidden;"></iframe>
When you browse the page that contains this iframe in IE/Firefox, the swf will NOT play until you make iframe visible. But if yo browse the page in Chrome, the swf will play automatically even if iframe is invisible.
Anyone can tell me why the swf(flash) behavior is differ in different browsers?
Cross-browsers problem always make crazy :).
Have you tried embedding the SWF using dynamic publishing instead of static publishing?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
var params = {};
params.play = "true";
var attributes = {};
swfobject.embedSWF("day_110702/ad.swf", "myAlternativeContent", "970", "250", "9.0.0", false, flashvars, params, attributes);
</script>
</head>
<body>
<div id="myAlternativeContent">
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</div>
</body>
</html>