Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-10-2010, 10:45 AM   PM User | #1
forgottenglory
Regular Coder

 
Join Date: May 2006
Posts: 128
Thanks: 3
Thanked 0 Times in 0 Posts
forgottenglory is an unknown quantity at this point
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
Click image for larger version

Name:	screenshot.gif
Views:	89
Size:	4.3 KB
ID:	8202  

Last edited by forgottenglory; 02-10-2010 at 10:55 AM..
forgottenglory is offline   Reply With Quote
Old 10-05-2010, 04:42 AM   PM User | #2
arcturus
New to the CF scene

 
Join Date: Aug 2010
Location: San Francisco
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
arcturus is an unknown quantity at this point
I found this thread through google, and I"m having the same problem. Anyone have any ideas?
arcturus is offline   Reply With Quote
Old 10-05-2010, 06:56 AM   PM User | #3
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
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!||||
_Aerospace_Eng_ is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:32 AM.


Advertisement
Log in to turn off these ads.