2011-09-12 12 views
0

私は現在、多言語でなければならないプロジェクトを行っています。 XMLファイルを見つけるためにFlash Varを使用する必要があります。CS3のFlash Varsを使用してURI XMLの場所を取得

なぜ以下のコードが機能しないのでしょうか?あなたはフラッシュが原因でスラッシュのvarsのエスケープする必要が

<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="195" height="160"> 
<param name="movie" value="../../../desktop.swf" /> 
<param name="quality" value="high" /> 
<param name="wmode" value="opaque" /> 
<param name="swfversion" value="6.0.65.0" /> 
<param name="FlashVars" value="xmlPath=привет/mp3.xml" /> 
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don't want users to see the prompt. --> 
<param name="expressinstall" value="../../../expressInstall.swf" /> 
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --> 
<!--[if !IE]>--> 
<object type="application/x-shockwave-flash" data="../../../desktop.swf" width="195" height="160"> 
<!--<![endif]--> 
<param name="quality" value="high" /> 
<param name="wmode" value="opaque" /> 
<param name="swfversion" value="6.0.65.0" /> 
<param name="FlashVars" value="xmlPath=привет/mp3.xml" /> 
<param name="expressinstall" value="../../../expressInstall.swf" /> 
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --> 
<div> 
    <h4>Content on this page requires a newer version of Adobe Flash Player.</h4> 
    <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" width="112" height="33" /></a></p> 
</div> 
<!--[if !IE]>--> 
</object> 
<!--<![endif]--> 
</object> 
<script type="text/javascript"> 
swfobject.registerObject("FlashID"); 
</script> 

答えて

0

var xmlPath:String; 
xmlPath = root.loaderInfo.parameters(encodeURIComponent["xmlPath"]); 

はここに私のHTMLコードです:

は、ここに私のAS3コードです。

[EDIT]

//Javascript 
<param name="FlashVars" value="xmlPath=привет&#47;mp3.xml" /> 

// AS3 
var xmlPath:String; 
xmlPath = unescape(root.loaderInfo.parameters(encodeURIComponent["xmlPath"])); 

これはmp3.xmlがブラウザに存在することを確認動作しない場合。

http://yourserver.com/привет/mp3.xml 
+0

var xmlPath:String; xmlPath = root.loaderInfo.parameters(エスケープ["xmlPath"]); これはまだ動作しません。 –

+0

あなたはJavaScript側でそれをエスケープし、AS3側でエスケープします。 –

+0

私の答えにあなたのためのいくつかのコードを追加しました。 –

関連する問題