を高く評価し、サイトAとB.
の両方へのアクセス権を持っています。セキュリティSanboxの問題があります。 Essential Actionscript 3.0にはセキュリティに関する全章がありますが、私はそれを短くしていきます。
のFlash IDEを使用して
、あなたは、2つの「セキュリティオプション」 あなたのswfファイルのいずれかが(同じドメインの)ローカルのクリップをロードするための権限、 いずれかのネットワークから(他のドメイン)
を持っている持っているのは、swfAがあるとしましょうサイト-A上のswfファイルとSWFBサイト-B
まず最初にswfファイルで、あなたはSWFB
などに使用するローダーにのLoaderContextを設定しよう
//1st param(true) in LoaderContext constructor means always check for policy files
var swfBLoaderContext:LoaderContext = new LoaderContext(true);
var swfBLoader:Loader = new Loader();
swfBLoader.contentLoaderInfo.addEventListener(Event.INIT, swfBLoaded);
swfBLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, swfBIOError);
swfBLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, swfBSecurityError);
swfBLoader.load(new URLRequest('http://siteb.com/b.swf',swfBLoaderContext);
function swfBLoaded(event:Event):void{
trace(event.target.content);
}
function swfBIOError(event:IOErrorEvent):void{
trace(event);
}
function swfBSecurityError(event:SecurityErrorEvent):void{
trace(event);
}
次に、ドキュメント設定でローカル再生セキュリティを変更してネットワークファイルにアクセスします。画像について
alt text http://www.adobe.com/devnet/flash/articles/local_network_playback/fig01.jpg
感謝のAdobe。
詳細については、this article on devnetを参照してください。
グッドラック。