I have a simple Flash animation which plays at the top of all my pages. Below is the code generated by Flash at publishing time, which detects the Flash version and embeds the initheader.swf in the html page. The code below works fine when all the files (ie html pages and swf file) are in the same folder.
Flash script in the header
Code:
<script language="javascript"> AC_FL_RunContent = 0; </script>
<script language="javascript"> DetectFlashVer = 0; </script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 24;
// -----------------------------------------------------------------------------
// -->
</script>
Javascript to embed Flash file in body
Code:
<script language="JavaScript" type="text/javascript">
<!--
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(hasRightVersion) { // if we've detected an acceptable version
// embed the flash movie
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0',
'width', '1003',
'height', '374',
'src', 'initheader',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'transparent',
'devicefont', 'false',
'id', 'initheader',
'bgcolor', '#ffffff',
'name', 'initheader',
'menu', 'true',
'allowScriptAccess','sameDomain',
'allowFullScreen','false',
'movie', 'initheader',
'salign', ''
); //end AC code
} else { // flash is too old or we can't detect the plugin
var alternateContent = '<img src="images/header.jpg" alt="static header" />';
document.write(alternateContent); // insert non-flash content
}
}
// -->
</script>
The problem arises when I duplicate a page (beginners.html) and move it inside another folder. The Flash animation doesn't play. All I have to do is to update the path to the swf file thus:
Code:
'src', '../initheader',
For some reason it just refuses to work and the animation doesn't play. Find attached a screenshot of my file structure. I would have thought that updating the path to a file is straightforward.
Can anybody please tell me what I'm doing wrong and how to fix the code?
Thanks