Hello,
I needed to use flash files in my site, so i wrote the following
function:
function flash($path, $name, $width, $height, $scale = "exactfit",
$wmode = "transparent"){
if (is_array($path)) {
$path = Router::url($path);
} elseif ($path{0} === '/') {
$path = $this->webroot($path);
} elseif (strpos($path, '://') !== false) {
$path = $path;
} else {
if (Configure::read('Asset.timestamp') == true &&
Configure::read()
> 0) {
$path .= '?' . @filemtime(str_replace('/', DS, WWW_ROOT
.
FLASHES_URL . $path));
}
$path = $this->webroot(FLASHES_URL . $path);
}
return '<script language="javascript">if (AC_FL_RunContent == 0)
{alert("This page requires AC_RunActiveContent.js. In Flash, run
\"Apply Active Content Update\" in the Commands menu to copy
AC_RunActiveContent.js to the HTML output folder.");} else
{AC_FL_RunContent(\'codebase\', \'https://download.macromedia.com/pub/
shockwave/cabs/flash/swflash.cab#version=8,0,0,0\',\'width\', \''.
$width.'\',\'height\', \''.$height.'\',\'src\', \''.$path.'\',\'quality
\', \'best\',\'pluginspage\', \'https://www.macromedia.com/go/
getflashplayer\',\'play\', \'true\',\'loop\', \'true\',\'scale\', \''.
$scale.'\',\'wmode\', \''.$wmode.'\',\'devicefont\', \'true\',\'name
\', \''.$name.'\',\'menu\', \'false\',\'allowScriptAccess\',
\'sameDomain\',\'movie\', \''.$path.'\',\'salign\', \'\');}</
script><noscript><object classid="clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/
pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'.
$width.'" height="'.$height.'"><param name="movie" value="'.
$path.'.swf" /><param name="quality" value="high" /><param
name="wmode" value="'.$wmode.'" /><embed src="'.$path.'.swf" width="'.
$width.'" height="'.$height.'" quality="high" pluginspage="http://
www.macromedia.com/go/getflashplayer" type="application/x-shockwave-
flash" wmode="'.$wmode.'"></embed></object></noscript>';
}
I also created a directory "cake\app\webroot\flash" and wrote the
following code in the paths.php:
define ('FLASHES', WWW_ROOT.'flash'.DS);
///
if (!defined('FLASHES_URL')) {
define ('FLASHES_URL', 'flash/');
}
I hope that the developers of cakePHP consider adding this function to
the official HTML helper as it helps maintaining the code when using
flash files.
I hope this helps.
Regards,
Ata Alqadi
www.swfmasters.net
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---