Time for action – authorizing on Android
- First, import the
StageWebView
class.import flash.media.StageWebView;
- Then, create an instance of it, set the size, and add an event listener.
var stageWebView:StageWebView = new StageWebView(); stageWebView.stage = this.stage; stageWebView.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight); stageWebView.addEventListener(LocationChangeEvent.LOCATION_CHANGE, onRedirect);
- This is very similar to what we did with desktop AIR, except that:
- Instead of using
addChild()
to add theStageWebView
to the display list, we set itsstage
property to the stage, becauseStageWebView
is not aDisplayObject
- Instead of setting the width and height separately, we use a
Rectangle
object to define an area onscreen ...
- Instead of using
Get Facebook Graph API Development with Flash now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.