[an error occurred while processing this directive]「&」(アンパサンド)で始まる外部テキストファイルを読み込むとエラーが表示される[an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive]

TechNote

[an error occurred while processing this directive][an error occurred while processing this directive]

[an error occurred while processing this directive]「&」(アンパサンド)で始まる外部テキストファイルを読み込むとエラーが表示される

この文書に対する評価をお願いします。


この情報は、米国アドビシステムズ社が提供している情報をもとにローカライズし、作成したものです。

問題 (Issue)

ActionScript 3.0 では、アンパサンド(&)で始まる外部ファイルをロードしようとしても、URLVariables クラスを使用しているためエラーになります。

理由 (Reason)

ActionScript 2.0 では LoadVars クラスを使用して、以下のようなアンパサンドが先頭に記述されている外部テキストをロードすることができました。

&name=peter

技術的には、上記のようなアンパサンドの用法は誤っているため、アンパサンドで始まるテキストファイルを読み込めないのが適切な動作ですが、Flash Player 9 よりも前のバージョンでは、先頭のアンパサンドは判別されません。ActionScript 3.0 は標準規格に対応するために、先頭にアンパサンドが記述されているテキストを読み込んだ場合、URLVariables クラスによって不適切な文字として判断するように設計されており、そのためにエラーメッセージが表示されます。


回避策 (Solution)

ActionScript 3.0 でこの問題を回避するには、読みこまれるテキストファイルの先頭に記述されているアンパサンドを削除します。

例えば「&name=peter」という記述の場合は読み込みができませんが、「name=peter」であれば読み込むことが可能です。

アンパサンドは、「first=peter&last=strauss」のようにデータファイル内で複数の変数に値を代入するために使用することができますが、アンパサンド自体を最終的に文字として出力するためには、以下の例のように「%26」を使用して URL エンコードする必要があります。

var1=Bent&var2=Ben%26Jerrys


関連ドキュメント (Related Records)

RELATED RECORDS

[an error occurred while processing this directive]

[an error occurred while processing this directive]
[an error occurred while processing this directive]

Creative Commons License

[an error occurred while processing this directive][an error occurred while processing this directive]

サポート情報検索 (Search Support)

[an error occurred while processing this directive]

ドキュメント情報 (Document Details)

最終更新 (Last Update): 2007-06-21
文書番号 (ID):231282
プラットフォーム (OS):Macintosh, Windows
http://go.adobe.com/kb/ts_231282_ja-jp

関連製品 (Product Affected)

flash
[an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive][an error occurred while processing this directive]