I threw together a simple app in flash ide / as3 that pulls photos from a foursquare location. It works locally but once deployed on the web it does not work. I would guess it's a crossdomain issue but what I've found online (link below) so far doesn't answer my question. http://groups.google.com/group/foursquare-api/browse_thread/thread/ab963f74fde8ae9f/3e68559966acf7c9
I've checked the local vs network setting.I've read I shouldn't need a crossdomain file on my server. And I believe I've read that I shouldn't need a php proxy for foursquare like I need with twitter... Not sure what else it can be.
the box where it says testing should trace the response but it never fills, it's like the call stops dead in its tracks after it hits the crossdomain file on foursquare and I don't even get an error response. http://physicalgraffitea.com/wp-content/swf/Foursquare-e.swf
Distilled the AS3 down to it's leanest here, sans the ID and Secret.
Any help? Thanks
Security.allowDomain("http://www.foursquare.com");
Security.loadPolicyFile("http://api.foursquare.com/crossdomain.xml");
import flash.net.URLRequest;
import flash.net.URLLoader;
import com.adobe.serialization.json.JSON;
var resource = "https://api.foursquare.com/v2/venues/4b7071c8f964a520d51a2de3/photos?group=venue&limit=6&client_id="+myId+"&client_secret="+mySecret+"&v=20120517";
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest(resource);
request.method = URLRequestMethod.GET;
loader.addEventListener(Event.COMPLETE, onComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR,onIOError);
loader.load(request);
function onComplete(e:Event):void {
var loader:URLLoader = URLLoader(e.target);
outputtxt.text = loader.data;
trace(loader.data);
var jsonData:Object = JSON.decode(loader.data)
}
function onIOError(e:Event):void {
var loader:URLLoader = URLLoader(e.target);
outputtxt.text = "error " + loader.data;
}