home *** CD-ROM | disk | FTP | other *** search
/ i·claim - visualizing argument / ICLAIM.ISO / mac / t_02.swf / scripts / __Packages / mx / controls / streamingmedia / Chrome.as < prev    next >
Text File  |  2005-02-25  |  2KB  |  91 lines

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