I am having problems accomplishing this as well. Ultimately I'd like to send the flash video file, width and height by page call and just have the flash video player available on any page type.
So as per tutorials on silverstripe, I added the following to mysite/code/Page.php:
function FlashVideo($vid,$width,$height){
return "<script language=\"javascript\">
if (AC_FL_RunContent == 0) {
alert(\"This page requires AC_RunActiveContent.js.\");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', $width,
'height', $height,
'src', 'AFC_EmbedPlayer',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'AFC_EmbedPlayer',
'bgcolor', '#ffffff',
'name', 'AFC_EmbedPlayer',
'menu', 'true',
'allowFullScreen', 'true',
'allowScriptAccess','sameDomain',
'movie', 'assets/Flash/AFC_EmbedPlayer',
'salign', '',
'FlashVars', 'flvURL=$vid&bufferSeconds=2&showBigPlayButton=true&showReplayButton=true&showBufferingIndicator=true&autoHideControls=false
&autoBuffer=true&autoStart=false&shrinkVideoOnComplete=true'
);
}
</script>
<noscript>
<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\"
width=$width height=$height id=\"AFC_EmbedPlayer\" align=\"middle\">
<param name=\"allowScriptAccess\" value=\"sameDomain\" />
<param name=\"allowFullScreen\" value=\"true\" />
<param name=\"movie\" value=\"assets/Flash/AFC_EmbedPlayer.swf\" />
<param name=\"quality\" value=\"high\" />
<param name=\"bgcolor\" value=\"#ffffff\" />
<param name=\"FlashVars\" value=\"flvURL=$vid&bufferSeconds=2&showBigPlayButton=true&showReplayButton=true&showBufferingIndicator=true&autoHideControls=false
&autoBuffer=true&autoStart=false&shrinkVideoOnComplete=true\" />
<embed src=\"assets/Flash/AFC_EmbedPlayer.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=$width height=$height name=\"AFC_EmbedPlayer\" align=\"middle\"
allowScriptAccess=\"sameDomain\" allowFullScreen=\"true\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"
FlashVars=\"flvURL=$vid&bufferSeconds=2&showBigPlayButton=true&showReplayButton=true&showBufferingIndicator=true&autoHideControls=false&autoBuffer=true&autoStart=false
&shrinkVideoOnComplete=true\" />
</object>
</noscript>";
}
When I call $FlashVideo("assets/Flash/Videos/file.flv","320","240") from the TinyMCE HTML editing window, all I get in publish is an echo of the line.
Any way to get this to work?