Why do I get Error#2036 in flash AS3 and how to solve this?
- by sydas
I'm currently building an application in flash in relation to RSS/XML feeds for a project. I'm stuck at the moment because I keep getting this error:
Error opening URL 'http://distilleryimage6.instagram.com/.jpg'
Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed.
I know my string picURL is not functioning properly, but am I missing something that makes it not functional? This is my code:
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;
}
}
}