views:

350

answers:

2

Hello, I'm building a website using Flex, Codeigniter, and I use swfobject to embed the swf. This will not work if I access the website using Codeigniter's index.php file.

This is the ouput source:

<html lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="http://localhost/Pixelatte-debug/"/&gt;
<link rel="stylesheet" type="text/css" href="history/history.css" />
<title>${title}</title>
<script src="AC_OETags.js" language="javascript"></script>
<script src="history/history.js" language="javascript"></script>

<style>
body { margin: 0px; overflow:hidden; background:url('swirlsbg.png') }
</style>

</head>

<body scroll="no">
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">

 var flashVars = {};

 var params = { play: "true",
       loop: "false",
       quality: "high",
       wmode: "transparent",
       allowscriptaccess: "sameDomain" };

 var attributes = { id: "${application}" };

 swfobject.embedSWF( "${swf}.swf",
      "divContent",
      "100%", "100%",
      "9.0.0",
      "expressInstall.swf",
      flashVars,
      params,
      attributes );
</script>

<div id="divContent">
 <h1>Alternative content</h1>
 <p><a href="http://www.adobe.com/go/getflashplayer"&gt;
 <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />

 </a></p>
</div>
</body>
</html>

My guess is that swfobject.js is not detected by codeigniter..

+1  A: 

What is the result? (The replacement text, or a broken object tag...?) Is swfobject.js loaded properly? Is your SWF file's path correct? What is your final HTML output? Maybe one of the details will solve your problem.

itarato
A: 

CodeIgniter won't be your issue here. You should use a tool like Firebug (a firefox plugin) to confirm your assets are actually being found.

Codeignitor won't know about your JS, your browser will. If the JS isn't running there is either a fault in the JS code, or it isn't found by your browser.

MrChrister