home *** CD-ROM | disk | FTP | other *** search
/ i·claim - visualizing argument / ICLAIM.ISO / pc / glossary.swf / scripts / __Packages / mx / controls / streamingmedia / Chrome.as < prev    next >
Encoding:
Text File  |  2005-02-24  |  2.6 KB  |  102 lines

  1. class mx.controls.streamingmedia.Chrome extends MovieClip
  2. {
  3.    var visible;
  4.    var width;
  5.    var height;
  6.    var _chromeEdge;
  7.    var _chromeHilite;
  8.    var _chromeFill;
  9.    var showToggles;
  10.    var _toggleNW;
  11.    var _toggleSW;
  12.    var _toggleNE;
  13.    var _toggleSE;
  14.    function Chrome()
  15.    {
  16.       super();
  17.       this.init();
  18.    }
  19.    function init()
  20.    {
  21.       if(this.visible == null)
  22.       {
  23.          this.visible = true;
  24.       }
  25.       if(this.width != null && this.height != null)
  26.       {
  27.          this.draw();
  28.       }
  29.       mx.controls.streamingmedia.Tracer.trace("Chrome.init: setting enabled to " + this._parent.enabled);
  30.       this.setEnabled(this._parent.enabled);
  31.    }
  32.    function setSize(w, h)
  33.    {
  34.       this.width = w;
  35.       this.height = h;
  36.    }
  37.    function draw()
  38.    {
  39.       if(this.visible)
  40.       {
  41.          this._alpha = 100;
  42.       }
  43.       else
  44.       {
  45.          this._alpha = 0;
  46.       }
  47.       this._chromeEdge._width = this.width;
  48.       this._chromeEdge._height = this.height;
  49.       this._chromeEdge._x = 0;
  50.       this._chromeEdge._y = 0;
  51.       this._chromeHilite._width = this.width - 2;
  52.       this._chromeHilite._x = 1;
  53.       this._chromeHilite._y = 1;
  54.       this._chromeFill._width = this.width - 2;
  55.       this._chromeFill._height = this.height - 3;
  56.       this._chromeFill._x = 1;
  57.       this._chromeFill._y = 2;
  58.       if(this.visible && this.showToggles)
  59.       {
  60.          this._toggleNW._visible = true;
  61.          this._toggleSW._visible = true;
  62.          this._toggleNE._visible = true;
  63.          this._toggleSE._visible = true;
  64.          this._toggleNW._x = 0;
  65.          this._toggleNW._y = 0;
  66.          this._toggleNE._x = this.width;
  67.          this._toggleNE._y = 0;
  68.          this._toggleSW._x = 0;
  69.          this._toggleSW._y = this.height;
  70.          this._toggleSE._x = this.width;
  71.          this._toggleSE._y = this.height;
  72.       }
  73.       else
  74.       {
  75.          this._toggleNW._visible = false;
  76.          this._toggleSW._visible = false;
  77.          this._toggleNE._visible = false;
  78.          this._toggleSE._visible = false;
  79.       }
  80.    }
  81.    function getAllToggles()
  82.    {
  83.       return [this._toggleNW,this._toggleNE,this._toggleSW,this._toggleSE];
  84.    }
  85.    function getOneToggle()
  86.    {
  87.       return this._toggleNE;
  88.    }
  89.    function getEnabled()
  90.    {
  91.       return this._parent.enabled;
  92.    }
  93.    function setEnabled(is)
  94.    {
  95.       mx.controls.streamingmedia.Tracer.trace("Chrome.setEnabled: " + is);
  96.       this._toggleNW.setEnabled(is);
  97.       this._toggleNE.setEnabled(is);
  98.       this._toggleSW.setEnabled(is);
  99.       this._toggleSE.setEnabled(is);
  100.    }
  101. }
  102.