Hi,
Im just getting started with the flickr api, I have been trying with out any real success to get some xml loaded from the url from flickr just to get started I created an account etc. and followed a few tutorials but I cant get it working i just want to load the xml and go from there. If I put the XML_FlickrBase into a browser it shows the xml I understand I need.
package
{
import flash.display.*;
import flash.net.*;
import flash.events.*;
import flash.display.MovieClip;
import flash.system.*;
Security.allowDomain("*", "api.flickr.com");
public class Main extends MovieClip
{
public var key:String = "";//your flickr api key
public var per_page:int = 50;
public var page:int = 1;
public var XML_FlickrBase:String = "http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=55dfc60e3919574ef151057db60bdbb0&tags=cats";
public var currentURL:String;
public var myXMLRequest;
public var myXMLLoader;
public function Main()
{
// constructor code
getRecentPhoto();
}
function loadImage(img_src:String)
{
}
function getRecentPhoto():void
{
currentURL = XML_FlickrBase;
myXMLLoader = new URLLoader(myXMLRequest);
myXMLLoader.addEventListener("complete", showFirstPhoto);
}
function showFirstPhoto(event:Event):void
{
var myXML:XML = new XML(myXMLLoader.data);
trace(myXML.toXMLString());
test.text = myXML.toXMLString();
trace('myXML.toXMLString(): ' + myXML.toXMLString());
}
}
}
Can any one help get me on the right track?