URLLoader
オブジェクトを使用して、Webサーバーからリモートコンテンツをロードしようとしています。 そのために、Adobeのヘルプのexampleコードを使用しました。ここでリモートコンテンツをロードするときに「エラー#2032:ストリームエラー」が発生する
は、私が試したものです:
var loader:URLLoader;
loader = new URLLoader();
configureListeners(loader);
var request:URLRequest = new URLRequest("http://www.fashionboxpk.com/Test2.php");
try
{
loader.load(request);
}
catch (error:Error)
{
trace("Unable to load requested document.");
}
function configureListeners(dispatcher:IEventDispatcher):void
{
dispatcher.addEventListener(Event.COMPLETE, completeHandler);
dispatcher.addEventListener(Event.OPEN, openHandler);
dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
}
function completeHandler(event:Event):void
{
var loader:URLLoader = URLLoader(event.target);
trace("completeHandler: " + loader.data);
}
function openHandler(event:Event):void
{
trace("openHandler: " + event);
}
function progressHandler(event:ProgressEvent):void
{
trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
}
function securityErrorHandler(event:SecurityErrorEvent):void
{
trace("securityErrorHandler: " + event);
}
function httpStatusHandler(event:HTTPStatusEvent):void
{
trace("httpStatusHandler: " + event);
}
function ioErrorHandler(event:IOErrorEvent):void
{
trace("ioErrorHandler: " + event);
}
しかし、コンパイル、私はこの出力を得た:
だから、openHandler: [Event type="open" bubbles=false cancelable=false eventPhase=2]
progressHandler loaded:384 total: 384
Error opening URL 'http://www.fashionboxpk.com/Test2.php'
httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=406 responseURL=null]
ioErrorHandler: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://www.fashionboxpk.com/Test2.php"]
、どのように私は、これらのエラーを回避することができ、正しくそのコンテンツをロードしますか?
[http://www.fashionboxpk.com/crossdomain.xml](http:/)のcrossdomain.xmlは存在しません/www.fashionboxpk.com/crossdomain.xml) –
スタックオーバーフローへようこそ。誰に良い質問をするのかについては、[this](http://stackoverflow.com/questions/ask/advice)をお読みください。良い質問はここで良い答えを得る。間違った質問は無視される傾向があります。 –
これは質問ですか?あなたが**本当に**ここで達成しようとしていることを説明してください... AS3を使用してブラウザタブでPHPページを開きますか?または、AS3にPHPページのコンテンツを読み込みますか? –