2012-07-11 56 views
0

當本地測試時,flashvars是否工作?當我使用swfObject V1.5使用Flash Player 10保存的文件對其進行測試時,它似乎不起作用。任何人都可以確認這應該在本地工作。通過flashvars和本地發短信

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head> 
<title>Screensaver</title> 
<script type="text/javascript" src="swfobject.js"></script> 
<style type="text/css"> 

    body { 
     background-color: #ffffff; 
    } 

    #flashcontent { 
     width: 100%x; 
     height: 100%; 
     margin: 0 auto; 
    } 

</style> 
</head> 
<body> 
<div id="flashcontent"> 
     <strong>You need to upgrade your Flash Player</strong> 
     This is replaced by the Flash content. 
     Place your alternate content here and users without the Flash plugin or with 
     Javascript turned off will see this. Content here allows you to leave out <code>noscript</code> 
     tags. Include a link to <a href="swfobject.html?detectflash=false">bypass the detection</a> if you wish. 
    </div> 

    <script type="text/javascript"> 
     var so = new SWFObject("screensaver.swf", "main", "100%", "100%", "10", "#ffffff"); 
     so.addVariable("rssFeedUrl", "campaign.xml"); 
     so.write("flashcontent"); 

    </script> 
</body> 
</html> 

然後在閃光燈我有這個。

var flashVars:Object=LoaderInfo(loaderInfo).parameters; 

var rss = flashVars.rssFeedUrl; 
+0

好吧,它的工作不完全確定問題是什麼。 – Chapsterj 2012-07-11 04:50:31

回答

0

我已經嘗試過SWFObject 2.2(最新版本)和本地工作的html參數通過沒有任何問題。

我想知道爲什麼你不會移動到最新版本的SWFObject。在你的情況下,代碼將看起來像

swfobject.embedSWF(
       "screensaver.swf", "main", 
       "100%", "100%", 
       "10", "", 
       { rssFeedUrl: "compaign.xml" }, {}, {});