I need display Flash content in my web page. I am developing my web site in WAMP and my PHP version is 2.5
<tr>
<td height="31" align="center" valign="middle"><object type="application/x-shockwave-flash" data="player_mp3_maxi.swf" width="260" height="23">
<param name="wmode" value="transparent" />
<param name="movie" value="player_mp3_maxi.swf" />
<param name="FlashVars" value="mp3=song.mp3&showstop=1&loop=1&autoplay=1&showvolume=1" />
<p>School Anthem</p>
</object></td>
</tr>
Unfortunately it is not displaying SWF file (Flash Player). Only displaying the School Anthem word. How can I fix this problem?
I would just use the <embed> tag (but I never needed flashvars, so may not work for you).
According to this Adobe article your <object> code should look something like :
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="260" height="23" id="myFlashMovie" align="middle">
<param name="movie" value="player_mp3_maxi.swf" />
<param name=FlashVars value="mp3=song.mp3&showstop=1&loop=1&autoplay=1&showvolume=1" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="player_mp3_maxi.swf" width="260" height="23">
<param name="movie" value="player_mp3_maxi.swf" />
<param name=FlashVars value="mp3=song.mp3&showstop=1&loop=1&autoplay=1&showvolume=1" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<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>
If still not working then try a new html page with this <embed>code below :
(Put .html file and swf file together in same place or folder. Does it show anything?).
<!DOCTYPE html>
<html>
<body>
<embed src="player_mp3_maxi.swf" width="800" height="600">
</body>
</html>
I've embedded a .swf file into my code but it won't show up when tested. It plays directly from the source (http://pandadol.com/pics/sydneyedit/300x250.swf) but not from the HTML file.
<html>
<head>
</head>
<body>
<object data="http://pandadol.com/pics/sydneyedit/300x250.swf">
<param name="movie" value="http://pandadol.com/pics/sydneyedit/300x250.swf">
</object>
<object data="http://www.adobe.com/jp/events/cs3_web_edition_tour/swfs/perform.swf">
<param name="movie" value="http://www.adobe.com/jp/events/cs3_web_edition_tour/swfs/perform.swf">
</object>
</body>
</html>
I've put it here with a default one from Adobe just to see if it wasn't my flash player that was the problem, but it seems to show up fine.
There has to be something ridiculous I'm missing. If anyone has a clue I'd appreciate it.
classid, codebase, and width and height are both required attributes for an <object> tag. Also the movie parameter is required.
http://helpx.adobe.com/flash/kb/flash-object-embed-tag-attributes.html
The code to use is:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" id="movie_name" align="middle">
<param name="movie" value="movie_name.swf"/>
<object type="application/x-shockwave-flash" data="movie_name.swf" width="550" height="400">
<param name="movie" value="movie_name.swf"/>
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player"/>
</a>
</object>
</object>
Or:
<div id="myContent">
<p>Alternative content</p>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0");
</script>
could anybody tell me how could I embed this video to a fancybox popup?
Video: http://www.tm-tube.com/video/28199/XTA+-+WAR+4+-+THC+VS+3DMAX+-+R3
Website: http://thc-racing.ucoz.com/index/gallery/0-9
Under: Having Fun! i would like to replace that image with the video from link above.
Is that possible?
Thanks!
First, go on TMTube and get the embed code for your video.
Second, use the Inline content way described in the Fancybox doc :
<a class="fancybox" id="inline" href="#video">This shows your video</a>
<div style="display:none">
<div id="video">
<script type="text/javascript" src="http://www.tm-tube.com/js/embed.js.php?id=28199"></script>
<noscript><object type="application/x-shockwave-flash" data="http://www.tm-tube.com/vimp.swf?playlistmode=media&mediaid=28199&webtv=false&hosturl=http%3A%2F%2Fwww.tm-tube.com%2Fflashcomm.php" id="flashcontent_511cc6b591bcf" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" name="c6a80378-3eb2-47e7-8415-ba1f7cff037e" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="480" height="270" align="middle"><param name="movie" value="http://www.tm-tube.com/vimp.swf?playlistmode=media&mediaid=28199&webtv=false&hosturl=http%3A%2F%2Fwww.tm-tube.com%2Fflashcomm.php" /><param name="width" value="480" /><param name="height" value="270" /><param name="align" value="middle" /><param name="quality" value="high" /><param name="allowscriptaccess" value="always" /></object></noscript>
</div>
</div>
Working jsFiddle.
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>
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>
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:
Don't define the width and height parameters in double quotes (when using %)
This technique will not work for XHTML, <embed> can't be within <object>
tag
Here is a short and to the point tut about embedding swf in html:
http://www.tizag.com/flashTutorial/flashhtmlcode.php
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.
How do you embed a SWF file in an HTML page?
The best approach to embed a SWF into an HTML page is to use SWFObject.
It is a simple open-source JavaScript library that is easy-to-use and standards-friendly method to embed Flash content.
It also offers Flash player version detection. If the user does not have the version of Flash required or has JavaScript disabled, they will see an alternate content. You can also use this library to trigger a Flash player upgrade. Once the user has upgraded, they will be redirected back to the page.
An example from the documentation:
<!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>SWFObject dynamic embed - step 3</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">
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0");
</script>
</head>
<body>
<div id="myContent">
<p>Alternative content</p>
</div>
</body>
</html>
A good tool to use along with this is the SWFObject HTML and JavaScript generator. It basically generates the HTML and JavaScript you need to embed the Flash using SWFObject. Comes with a very simple UI for you to input your parameters.
It Is highly recommended and very simple to use.
<object width="100" height="100">
<param name="movie" value="file.swf">
<embed src="file.swf" width="100" height="100">
</embed>
</object>
How about simple HTML5 tag embed?
<!DOCTYPE html>
<html>
<body>
<embed src="anim.swf">
</body>
</html>
This is suitable for application from root environment.
<object type="application/x-shockwave-flash" data="/dir/application.swf"
id="applicationID" style="margin:0 10px;width:auto;height:auto;">
<param name="movie" value="/dir/application.swf" />
<param name="wmode" value="transparent" /> <!-- Or opaque, etc. -->
<!-- ↓ Required paramter or not, depends on application -->
<param name="FlashVars" value="" />
<param name="quality" value="high" />
<param name="menu" value="false" />
</object>
Additional parameters should be/can be added which depends on .swf it self. No embed, just object and parameters within, so, it remains valid, working and usable everywhere, it doesn't matter which !DOCTYPE is all about. :)
If you are using one of those js libraries to insert Flash, I suggest adding plain object embed tag inside of <noscript/>.
<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/VhtIydTmOVU&hl=en&fs=1&color1=0xe1600f&color2=0xfebd01"
style="width:640px;height:480px;margin:10px 36px;">
<param name="movie" value="http://www.youtube.com/v/VhtIydTmOVU&hl=en&fs=1&color1=0xe1600f&color2=0xfebd01" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="wmode" value="opaque" />
<param name="quality" value="high" />
<param name="menu" value="false" />
</object>
I use http://wiltgen.net/objecty/, it helps to embed media content and avoid the IE "click to activate" problem.
As mentioned SWF Object is great. UFO is worth a look as well
This one will work, I am sure!
<embed src="application.swf" quality="high" pluginspage="http://www.macromedia.com/go/getfashplayer" type="application/x-shockwave-flash" width="690" height="430">
What is the 'best' way? Words like 'most efficient,' 'fastest rendering,' etc. are more specific. Anyway, I am offering an alternative answer that helps me most of the time (whether or not is 'best' is irrelevant).
Alternate answer: Use an iframe.
That is, host the SWF file on the server. If you put the SWF file in the root or public_html folder then the SWF file will be located at www.YourDomain.com/YourFlashFile.swf.
Then, on your index.html or wherever, link the above location to your iframe and it will be displayed around your content wherever you put your iframe. If you can put an iframe there, you can put an SWF file there. Make the iframe dimensions the same as your SWF file. In the example below, the SWF file is 500 by 500.
Pseudo code:
<iframe src="//www.YourDomain.com/YourFlashFile.swf" width="500" height="500"></iframe>
The line of HTML code above will embed your SWF file. No other mess needed.
Pros: W3C compliant, page design friendly, no speed issue, minimalist approach.
Cons: White space around your SWF file when launched in a browser.
That is an alternate answer. Whether it is the 'best' answer depends on your project.
I know this is an old question. But this answer will be good for the present.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>histo2</title>
<style type="text/css" media="screen">
html, body { height:100%; background-color: #ffff99;}
body { margin:0; padding:0; overflow:hidden; }
#flashContent { width:100%; height:100%; }
</style>
</head>
<body>
<div id="flashContent">
<object type="application/x-shockwave-flash" data="histo2.swf" width="822" height="550" id="histo2" style="float: none; vertical-align:middle">
<param name="movie" value="histo2.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffff99" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</object>
</div>
</body>
</html>
Thi works on IE, Edge, Firefox, Safari and Chrome.
<object type="application/x-shockwave-flash" data="movie.swf" width="720" height="480">
<param name="movie" value="movie.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</object>
This worked for me:
<a target="_blank" href="{{ entity.link }}">
<object type="application/x-shockwave-flash" data="{{ entity.file.path }}?clickTAG={{ entity.link }}" width="120" height="600" style="visibility: visible;">
<param name="quality" value="high">
<param name="play" value="true">
<param name="LOOP" value="false">
<param name="wmode" value="transparent">
<param name="allowScriptAccess" value="true">
</object>
</a>
Use the <embed> element:
<embed src="file.swf" width="854" height="480"></embed>
You can use JavaScript if you're familiar with, like that:
swfobject.embedSWF("filename.swf", "Title", "width", "height", "9.0.0");
--the 9.0.0 is the flash version.
Or you can use the <object> tag of HTML5.