Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2006
    Thanked 0 Times in 0 Posts

    How to update path for SWF file to display properly

    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
    <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;
    // -----------------------------------------------------------------------------
    // -->
    Javascript to embed Flash file in body
    <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
    			'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',
    			'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
    // -->
    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:

    '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?

    Attached Thumbnails Attached Thumbnails -screenshot-gif  
    Last edited by forgottenglory; 02-10-2010 at 11:55 AM.

  2. #2
    New to the CF scene
    Join Date
    Aug 2010
    San Francisco
    Thanked 0 Times in 0 Posts
    I found this thread through google, and I"m having the same problem. Anyone have any ideas?

  3. #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    In a place far, far away...
    Thanked 1,043 Times in 1,019 Posts
    Can't help you without a link to your site.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts