Zend - The PHP Company




Graphics

Add Code


Embed Flash  

Type: code fragment
Added by: nyquist
Entered: 17/10/2001
Last modified: 01/11/2000
Rating: - (fewer than 3 votes)
Views: 7093
Embed Flash swf's in php using a function call from another php file


<?php
Add this 
function to an include-able php file.

=================
CUT====================
function 
flashembed($file$width$height) {
$swfdir "images/swf";
echo 
"<tr><td><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=$width HEIGHT=$height>
 
<PARAM NAME=movie VALUE="$swfdir/$file.swf">
 <
PARAM NAME=quality VALUE=high>
 <
PARAM NAME=menu VALUE=false>
 <
EMBED src="$swfdir/$file.swf" quality=high WIDTH=$width HEIGHT=$height TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" menu="false"></EMBED>
 </
OBJECT></tr></td>";
}
=================CUT====================

Include the function file; and call the function, specifying the swf file, the width and height e.g.

include ('functions.php');
flashembed(test, 700, 400);



?>


Usage Example




Rate This Script





Search



This Category All Categories