home *** CD-ROM | disk | FTP | other *** search
- class mx.controls.streamingmedia.Chrome extends MovieClip
- {
- var visible;
- var width;
- var height;
- var _chromeEdge;
- var _chromeHilite;
- var _chromeFill;
- var showToggles;
- var _toggleNW;
- var _toggleSW;
- var _toggleNE;
- var _toggleSE;
- function Chrome()
- {
- super();
- this.init();
- }
- function init()
- {
- if(this.visible == null)
- {
- this.visible = true;
- }
- if(this.width != null && this.height != null)
- {
- this.draw();
- }
- mx.controls.streamingmedia.Tracer.trace("Chrome.init: setting enabled to " + this._parent.enabled);
- this.setEnabled(this._parent.enabled);
- }
- function setSize(w, h)
- {
- this.width = w;
- this.height = h;
- }
- function draw()
- {
- if(this.visible)
- {
- this._alpha = 100;
- }
- else
- {
- this._alpha = 0;
- }
- this._chromeEdge._width = this.width;
- this._chromeEdge._height = this.height;
- this._chromeEdge._x = 0;
- this._chromeEdge._y = 0;
- this._chromeHilite._width = this.width - 2;
- this._chromeHilite._x = 1;
- this._chromeHilite._y = 1;
- this._chromeFill._width = this.width - 2;
- this._chromeFill._height = this.height - 3;
- this._chromeFill._x = 1;
- this._chromeFill._y = 2;
- if(this.visible && this.showToggles)
- {
- this._toggleNW._visible = true;
- this._toggleSW._visible = true;
- this._toggleNE._visible = true;
- this._toggleSE._visible = true;
- this._toggleNW._x = 0;
- this._toggleNW._y = 0;
- this._toggleNE._x = this.width;
- this._toggleNE._y = 0;
- this._toggleSW._x = 0;
- this._toggleSW._y = this.height;
- this._toggleSE._x = this.width;
- this._toggleSE._y = this.height;
- }
- else
- {
- this._toggleNW._visible = false;
- this._toggleSW._visible = false;
- this._toggleNE._visible = false;
- this._toggleSE._visible = false;
- }
- }
- function getAllToggles()
- {
- return [this._toggleNW,this._toggleNE,this._toggleSW,this._toggleSE];
- }
- function getOneToggle()
- {
- return this._toggleNE;
- }
- function getEnabled()
- {
- return this._parent.enabled;
- }
- function setEnabled(is)
- {
- mx.controls.streamingmedia.Tracer.trace("Chrome.setEnabled: " + is);
- this._toggleNW.setEnabled(is);
- this._toggleNE.setEnabled(is);
- this._toggleSW.setEnabled(is);
- this._toggleSE.setEnabled(is);
- }
- }
-