home *** CD-ROM | disk | FTP | other *** search
- package com.facebook.views
- {
- import flash.display.NativeWindow;
- import flash.display.NativeWindowInitOptions;
- import flash.display.NativeWindowType;
- import flash.display.StageAlign;
- import flash.display.StageScaleMode;
- import flash.events.Event;
- import flash.html.HTMLLoader;
- import flash.net.URLRequest;
- import flash.net.URLVariables;
-
- public class BaseWindow extends NativeWindow
- {
- public static const DEFAULT_WIDTH:Number = 640;
-
- public static const DEFAULT_HEIGHT:Number = 480;
-
- public static const PADDING:Number = 20;
-
- protected var distractor:Distractor;
-
- protected var _html:HTMLLoader;
-
- protected var urlVars:URLVariables;
-
- protected var req:URLRequest;
-
- public function BaseWindow()
- {
- var _loc1_:NativeWindowInitOptions = new NativeWindowInitOptions();
- _loc1_.type = NativeWindowType.UTILITY;
- _loc1_.resizable = false;
- _loc1_.maximizable = false;
- super(_loc1_);
- activate();
- alwaysInFront = true;
- addEventListener(Event.CLOSING,this.onClosing,false,0,true);
- stage.scaleMode = StageScaleMode.NO_SCALE;
- stage.align = StageAlign.TOP_LEFT;
- width = DEFAULT_WIDTH;
- height = DEFAULT_HEIGHT;
- this._html = new HTMLLoader();
- stage.addChild(this._html);
- this._html.addEventListener(Event.COMPLETE,this.onComplete,false,0,true);
- this._html.addEventListener(Event.LOCATION_CHANGE,this.onLocationChange,false,0,true);
- this.distractor = new Distractor();
- stage.addChild(this.distractor);
- this.urlVars = new URLVariables();
- this.req = new URLRequest();
- this.req.data = this.urlVars;
- }
-
- protected function onLocationChange(param1:Event) : void
- {
- this._html.width = this._html.height = 0;
- this.distractor.visible = true;
- }
-
- public function get html() : HTMLLoader
- {
- return this._html;
- }
-
- protected function onComplete(param1:Event) : void
- {
- this.distractor.visible = false;
- this._html.width = DEFAULT_WIDTH;
- this._html.height = DEFAULT_HEIGHT;
- }
-
- protected function onClosing(param1:Event) : void
- {
- }
- }
- }
-
-