View Full Version : embeding flash with javascript
dabontv
Sep 9th 2006, 8:53 pm
I was wondering if there was a way to embed a .swf file using java instead of html. I remeber ready somewhere that you could, but I can't find it and I want to find out.
Pat Gael
Sep 9th 2006, 9:02 pm
Yes, there is a way.
This is the way I have embedded flash on my website's intro:
<script type="text/javascript" language="javascript"><!--
var flashwidth = "800"
var flashheight = "400"
var color = "0000FF"
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+flashwidth+'" HEIGHT="'+flashheight+'" id="YOUR_MOVIE">');
document.write('<PARAM NAME="movie" VALUE="YOUR_MOVIE.swf">');
document.write('<PARAM NAME="quality" VALUE="high">');
document.write('<PARAM NAME="wmode" VALUE="transparent">');
document.write('<PARAM NAME="bgcolor" VALUE="#'+color+'">');
document.write('<EMBED src="YOUR_MOVIE.swf" quality="high" wmode="transparent" bgcolor="#'+color+'" WIDTH="'+flashwidth+'" HEIGHT="'+flashheight+'" NAME="YOUR_MOVIE" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write('</EMBED>');
document.write('</OBJECT><br>');
//-->
change YOUR_MOVIE for your own file name and ID.
dabontv
Sep 9th 2006, 9:59 pm
alright, thanks a lot
ashiezai
Sep 9th 2006, 11:39 pm
May i know what is the rational behind this?
Why can't just use the plain and simple html? And advantage of this?
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.