Skip to content

Instantly share code, notes, and snippets.

@seaders
Created July 27, 2013 00:39
Show Gist options
  • Save seaders/6093155 to your computer and use it in GitHub Desktop.
Save seaders/6093155 to your computer and use it in GitHub Desktop.
Little bit of code to show how Flash doesn't handle a redirect, which is incredibly common for interacting with Facebook images.
package
{
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;
import flash.system.LoaderContext;
public class RedirectTest extends Sprite
{
public function RedirectTest()
{
var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
l.load( new URLRequest('https://graph.facebook.com/4/picture'), new LoaderContext(true) );
}
protected function onComplete(event:Event):void
{
this.addChild((event.target as LoaderInfo).content);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment