Created
July 27, 2013 00:39
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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