home *** CD-ROM | disk | FTP | other *** search
/ i·claim - visualizing argument / ICLAIM.ISO / pc / glossary.swf / scripts / __Packages / mx / screens / Screen.as
Encoding:
Text File  |  2005-02-24  |  4.4 KB  |  173 lines

  1. class mx.screens.Screen extends mx.controls.Loader
  2. {
  3.    var _childScreens;
  4.    var border_mc;
  5.    static var symbolName = "Screen";
  6.    static var symbolOwner = mx.screens.Screen;
  7.    var className = "Screen";
  8.    var _isScreen = true;
  9.    var _indexInParent = 0;
  10.    var __transitionManager = null;
  11.    var _childLoading = "";
  12.    var borderStyle = "none";
  13.    function Screen()
  14.    {
  15.       super();
  16.    }
  17.    function get indexInParent()
  18.    {
  19.       return this._indexInParent;
  20.    }
  21.    function get numChildScreens()
  22.    {
  23.       return this._childScreens.length;
  24.    }
  25.    function get parentIsScreen()
  26.    {
  27.       var _loc2_ = this.parentScreen != null && this.parentScreen._isScreen;
  28.       return _loc2_;
  29.    }
  30.    function get parentScreen()
  31.    {
  32.       var _loc2_ = this._parent;
  33.       if(_loc2_ == null)
  34.       {
  35.          return null;
  36.       }
  37.       if(_loc2_._isScreen)
  38.       {
  39.          return _loc2_;
  40.       }
  41.       return null;
  42.    }
  43.    function get rootScreen()
  44.    {
  45.       var _loc2_ = this;
  46.       while(_loc2_.parentIsScreen)
  47.       {
  48.          _loc2_ = _loc2_.parentScreen;
  49.       }
  50.       return _loc2_;
  51.    }
  52.    function get transitionManager()
  53.    {
  54.       return this.__transitionManager;
  55.    }
  56.    static function get currentFocusedScreen()
  57.    {
  58.       var curFocus;
  59.       curFocus = _root.focusManager.getFocus();
  60.       if(!curFocus || curFocus == undefined)
  61.       {
  62.          curFocus = eval(Selection.getFocus());
  63.       }
  64.       while(curFocus && !curFocus._isScreen)
  65.       {
  66.          curFocus = curFocus._parent;
  67.       }
  68.       if(curFocus == undefined)
  69.       {
  70.          return null;
  71.       }
  72.       return curFocus;
  73.    }
  74.    function getChildScreen(childIndex)
  75.    {
  76.       return this._childScreens[childIndex];
  77.    }
  78.    function createChild(className, instanceName, initProps)
  79.    {
  80.       var _loc4_ = undefined;
  81.       this._childLoading = instanceName;
  82.       return super.createChild(className,instanceName,initProps);
  83.    }
  84.    function drawFocus()
  85.    {
  86.    }
  87.    function init()
  88.    {
  89.       mx.core.ext.UIObjectExtensions.Extensions();
  90.       mx.core.ext.UIComponentExtensions.Extensions();
  91.       mx.events.LowLevelEvents.enableLowLevelEvents();
  92.       this._childScreens = [];
  93.       super.init();
  94.       this._loadExternalClass = mx.screens.Screen.symbolName;
  95.       this.scaleContent = false;
  96.       mx.events.UIEventDispatcher.initialize(this);
  97.       if(this._parent._childLoading != this._name)
  98.       {
  99.          if(this.parentIsScreen)
  100.          {
  101.             this._parent.registerChildScreen(this);
  102.          }
  103.       }
  104.    }
  105.    function registerChildScreen(scrn)
  106.    {
  107.       scrn._indexInParent = this._childScreens.push(scrn) - 1;
  108.    }
  109.    function childLoaded(obj)
  110.    {
  111.       super.childLoaded(obj);
  112.       var _loc4_ = undefined;
  113.       var _loc5_ = null;
  114.       var _loc7_ = obj._parent;
  115.       for(_loc4_ in obj)
  116.       {
  117.          if(typeof obj[_loc4_] == "movieclip" && obj[_loc4_]._isScreen)
  118.          {
  119.             _loc5_ = obj[_loc4_];
  120.             break;
  121.          }
  122.       }
  123.       if(_loc5_._isScreen)
  124.       {
  125.          if(!this.scaleContent)
  126.          {
  127.             var _loc6_ = new Object();
  128.             _loc6_.x = obj.x;
  129.             _loc6_.y = obj.y;
  130.             this.globalToLocal(_loc6_);
  131.             obj._x = _loc6_.x;
  132.             obj._y = _loc6_.y;
  133.          }
  134.          else
  135.          {
  136.             _loc6_ = new Object();
  137.             _loc6_.x = this.x;
  138.             _loc6_.y = this.y;
  139.             this._parent.localToGlobal(_loc6_);
  140.             obj.globalToLocal(_loc6_);
  141.             _loc5_._x = _loc6_.x;
  142.             _loc5_._y = _loc6_.y;
  143.          }
  144.          _loc5_._indexInParent = _loc7_._childScreens.push(_loc5_) - 1;
  145.          obj._isScreenContainer = true;
  146.          obj._containedScreen = _loc5_;
  147.       }
  148.       _loc7_._childLoading = "";
  149.    }
  150.    function doScaleLoader()
  151.    {
  152.    }
  153.    function createChildren()
  154.    {
  155.       this.border_mc = new mx.skins.RectBorder();
  156.       this.border_mc.__borderMetrics = {top:0,left:0,bottom:0,right:0};
  157.       super.createChildren();
  158.    }
  159.    function allTransitionsInDone()
  160.    {
  161.       this.dispatchEvent({type:"allTransitionsInDone",target:this});
  162.    }
  163.    function allTransitionsOutDone()
  164.    {
  165.       this.dispatchEvent({type:"allTransitionsOutDone",target:this});
  166.    }
  167.    function destroyChildAt(childIndex)
  168.    {
  169.       this._childScreens.splice(childIndex,1);
  170.       super.destroyChildAt(childIndex);
  171.    }
  172. }
  173.