簡體   English   中英

SWFObject - 如何將SWF嵌入到html的不同文件夾中?

[英]SWFObject - How to embed SWF in a different folder to the html?

    <div id="flashContent">
        <h1>You need at least Flash Player 9.0 to view this page.</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>

    <script type="text/javascript">
        //Dynamic publishing with swfObject 

        //A 'name' attribute with the same value as the 'id' is REQUIRED for Chrome/Mozilla browsers
        var flashvars = {};
        var params = {"base": "../flashgame_new/"};
        var attributes = {id: "iTag", name: "iTag"};
        swfobject.embedSWF("flashgame.swf", "flashgame", "720", "610", "9.0", null, flashvars, params, attributes);
    </script>
  • 根文件中的html文件。
  • 它試圖在'/ iTag_FLASH_new /'中加載'iTag.swf'
  • 我嘗試在swfURL參數中輸入路徑 - embedSWF(“/ iTag_FLASH_new / iTag.swf” - - 這不起作用,文件無法加載
  • 一些谷歌搜索告訴我這是因為我必須通過改變基本路徑來指定路徑 - 這也不起作用,文件仍然沒有加載。

我可能只是犯了一個非常愚蠢的錯誤,因為我很累,但有人有任何建議嗎? 干杯。

嘗試在基本路徑中刪除“..”並引導“/”。

var params = {"base": "iTag_FLASH_new/"};

您不需要指定“base”標記,可以將其指定為embedSWF的一部分。

根據您的信息:頁面位於:(http://blah/whatever.html),閃光燈位於:(http://blah/iTag_FLASH_new/iTag.swf)

我將直接在瀏覽器中確保swf正確加載的路徑...

如果您的頁面位於:(http://blah/somedirectory/whatever.html)並且閃存處於(http://blah/somedirectory/iTag_FLASH_new/iTag.swf)

你需要將路徑指定為“iTag_FLASH_new / iTag.swf”,注意缺少斜線。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM