Time for action – authorizing on Android

  1. First, import the StageWebView class.
    import flash.media.StageWebView;
  2. 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);
  3. This is very similar to what we did with desktop AIR, except that:
    • Instead of using addChild() to add the StageWebView to the display list, we set its stage property to the stage, because StageWebView is not a DisplayObject
    • Instead of setting the width and height separately, we use a Rectangle object to define an area onscreen ...

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.