Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    128
    Thanks
    3
    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
    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
    Attached Thumbnails Attached Thumbnails How to update path for SWF file to display properly-screenshot.gif  
    Last edited by forgottenglory; 02-10-2010 at 11:55 AM.

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

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Can't help you without a link to your site.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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