home *** CD-ROM | disk | FTP | other *** search
- package com.facebook.views
- {
- import flash.events.Event;
-
- public class PermissionWindow extends BaseWindow
- {
- public static const PATH:String = "http://www.facebook.com/connect/prompt_permissions.php";
-
- public static const SUCCESS_PATH:String = "http://www.facebook.com/connect/login_success.html";
-
- public static const DEFAULT_WIDTH:Number = 640;
-
- public static const DEFAULT_HEIGHT:Number = 480;
-
- public function PermissionWindow()
- {
- super();
- urlVars.connect_display = "popup";
- urlVars.nochrome = true;
- urlVars.v = "1.0";
- urlVars.fbconnect = true;
- urlVars.channel_url = SUCCESS_PATH;
- urlVars.extern = "1";
- urlVars.display = "popup";
- urlVars.next = "http://www.facebook.com/connect/login_success.html?xxRESULTTOKENxx";
- req.url = PATH;
- distractor.text = "Loading Permissions";
- distractor.x = width - distractor.width >> 1;
- distractor.y = height - distractor.height >> 1;
- }
-
- override protected function onComplete(param1:Event) : void
- {
- distractor.visible = false;
- if(!closed)
- {
- width = html.width = DEFAULT_WIDTH;
- height = html.height = DEFAULT_HEIGHT;
- distractor.x = width - distractor.width >> 1;
- distractor.y = height - distractor.height >> 1;
- }
- }
-
- public function askPermissions(param1:Array, param2:String) : void
- {
- urlVars.ext_perm = param1.join(",");
- urlVars.api_key = param2;
- html.load(req);
- }
-
- override protected function onLocationChange(param1:Event) : void
- {
- if(html.location.indexOf(SUCCESS_PATH) > -1)
- {
- close();
- }
- else
- {
- html.width = html.height = 0;
- distractor.visible = true;
- }
- }
-
- override protected function onClosing(param1:Event) : void
- {
- }
- }
- }
-
-