2010-01-01 49 views
1

我正在使用Flex,Codeigniter構建網站,並使用swfobject來嵌入swf。 如果我使用Codeigniter的index.php文件訪問網站,這將不起作用。Codeigniter和SWFObject

這是輸出中源:

<html lang="en"> 

<head> 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<base href="http://localhost/Pixelatte-debug/"/> 
<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"> 
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> 

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

我的猜測是,swfobject.js沒有被檢測到的CodeIgniter ..

回答

1

結果是什麼? (替換文字,或破碎的對象標籤...?) swfobject.js是否正確加載? 你的SWF文件的路徑是否正確? 你最終的HTML輸出是什麼? 也許其中一個細節將解決您的問題。

0

CodeIgniter不會是你的問題在這裏。你應該使用像Firebug(一個Firefox插件)的工具來確認你的資產實際上正在被發現。

Codeignitor不會知道你的JS,你的瀏覽器會。如果JS沒有運行,那麼JS代碼中有一個錯誤,或者它沒有被你的瀏覽器找到。