我目前正在构建一个与项目的 RSS/XML 提要相关的 Flash 应用程序。我现在被卡住了,因为我不断收到这个错误:
打开 URL 'http://distilleryimage6.instagram.com/.jpg' 时出错 错误 #2044:未处理的 IOErrorEvent:。文本=错误 #2036:加载从未完成。
我知道我的字符串 picURL 无法正常运行,但我是否遗漏了一些使其无法正常运行的内容?这是我的代码:
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class instagramFeed extends MovieClip {
//link to #rit xml loader
public var ritFileRequest = new URLRequest("http://instagram.com/tags/rit/feed/recent.rss");
public var ritXmlLoader = new URLLoader();
//link to #rochester xml loader
// same as above public variables
public function instagramFeed() {
// constructor code
trace("About to load...");
//Loads #rit hashtag xml data.
ritXmlLoader.load(ritFileRequest);
ritXmlLoader.addEventListener(Event.COMPLETE, displayRITInfo);
}
//focuses on data with #rit hashtag
public function displayRITInfo(e:Event):void{
var ritInstagramData:XML = new XML(ritXmlLoader.data);
var ritInfoList:XMLList = ritInstagramData.elements().item;
trace(ritInfoList);
//load the image
var ritPic:String = ritInfoList.*::condition.@code;
var picURL:String = "http://distilleryimage6.instagram.com/" + ritPic + ".jpg";
trace(picURL);
//show the image on the stage!
var ritImageRequest:URLRequest = new URLRequest(picURL);
var ritImageLoader:Loader = new Loader();
ritImageLoader.load(ritImageRequest);
addChild(ritImageLoader);
ritImageLoader.x=200;
ritImageLoader.y=100;
ritImageLoader.scaleX = 3;
ritImageLoader.scaleY = 3;
}
}
}