I have added some javascript to my page.tpl that uses a .js file. The script is used to embed a flash .swf in a way that is xhtml strict compliant. When i set up the pages and scripts in local folders they work properly, but when i upload the files to the server, it seems that the page.tpl either can not locate the .swf file or can not locate the .js file. I have tried putting the .js file in various places such as script folder and in with the page.tpl. I have also tried the .swf in various locations as well. When ever i try to view it though something isnt working right.

Is there a certain directory that .swf files or .js files need to go for drupal to be able to find them properly?

Comments

roadkill-1’s picture

  <head>
	<title><?php print $head_title ?></title>
	<?php print $head ?>
	<?php print $styles ?>
	<?php print $scripts ?>
<script type="text/javascript" src="Scripts/swfobject.js"></script>
<script type="text/javascript" src="Scripts/AC_RunActiveContent.js"></script>
</head>

<body>

	<div id="flashcontent">
You must download Flash etc...
	</div>

	<script type="text/javascript">
		// <![CDATA[
		
		var so = new SWFObject("animation.swf", "sotester", "831", "153", "9", "#FF6600");
		so.write("flashcontent");
		
		// ]]>
	</script>

behindthepage’s picture

I have had similar problems. Usually it is fixed by putting a slash at the beginning of paths
e.g. src="/Scripts/swfobject.js"
or changing the chmod permissions of the files.

gpdinoz
"Everything should be made as simple as possible, but not simpler." - Albert Einstein

Regards
Geoff

roadkill-1’s picture

Ya i tried everything i could think of with the paths. Nothing seems to work. Can you elaborate on chmod permissions? Im not sure how to do that.

behindthepage’s picture

I suggest you google and search Drupal.org on chmod and folder permissions as they are essential knowledge for doing anything on a *nix based server.

Another thing to do is create a test html page on your server and test each link in your program sequence to help you identify where the problem is. Often I have thought the problem was one thing when it was something completely different. Especially with a complex system like drupal there can be many things to go wrong.

E.g. Create a simple html page that loads a simple javascript that prints "hello world". When you get that working you will have solved any paths issues and Chmod issues. Then go onto the next step, maybe there is a javascript problem.

Also try all lowercase folder and file names sometimes that can cause problems.

gpdinoz
"Everything should be made as simple as possible, but not simpler." - Albert Einstein

Regards
Geoff

brf123’s picture

Has this issue been resolved. I am trying to do the exact same thing with the same flash script. Any additional help would be appreciated.
Thanks!