home *** CD-ROM | disk | FTP | other *** search
/ Leer Poker Spelen / Unibet.iso / content / screens_i.swf / scripts / __Packages / mx / video / UIManager.as < prev    next >
Encoding:
Text File  |  2007-12-19  |  58.2 KB  |  1,727 lines

  1. class mx.video.UIManager
  2. {
  3.    var _vc;
  4.    var _skin;
  5.    var _skinAutoHide;
  6.    var _skinReady;
  7.    var __visible;
  8.    var _bufferingBarHides;
  9.    var _controlsEnabled;
  10.    var _lastScrubPos;
  11.    var _lastVolumePos;
  12.    var cachedSoundLevel;
  13.    var _isMuted;
  14.    var controls;
  15.    var customClips;
  16.    var skin_mc;
  17.    var skinLoader;
  18.    var layout_mc;
  19.    var border_mc;
  20.    var _seekBarIntervalID;
  21.    var _seekBarInterval;
  22.    var _seekBarScrubTolerance;
  23.    var _volumeBarIntervalID;
  24.    var _volumeBarInterval;
  25.    var _volumeBarScrubTolerance;
  26.    var _bufferingDelayIntervalID;
  27.    var _bufferingDelayInterval;
  28.    var _bufferingOn;
  29.    var _skinAutoHideIntervalID;
  30.    var _progressPercent;
  31.    var uiMgr;
  32.    var state;
  33.    var _focusrect;
  34.    var controlIndex;
  35.    var placeholderLeft;
  36.    var placeholderRight;
  37.    var placeholderTop;
  38.    var placeholderBottom;
  39.    var videoLeft;
  40.    var videoRight;
  41.    var videoTop;
  42.    var videoBottom;
  43.    var _playAfterScrub;
  44.    static var version = "1.0.0.103";
  45.    static var PAUSE_BUTTON = 0;
  46.    static var PLAY_BUTTON = 1;
  47.    static var STOP_BUTTON = 2;
  48.    static var SEEK_BAR_HANDLE = 3;
  49.    static var BACK_BUTTON = 4;
  50.    static var FORWARD_BUTTON = 5;
  51.    static var MUTE_ON_BUTTON = 6;
  52.    static var MUTE_OFF_BUTTON = 7;
  53.    static var VOLUME_BAR_HANDLE = 8;
  54.    static var NUM_BUTTONS = 9;
  55.    static var PLAY_PAUSE_BUTTON = 9;
  56.    static var MUTE_BUTTON = 10;
  57.    static var BUFFERING_BAR = 11;
  58.    static var SEEK_BAR = 12;
  59.    static var VOLUME_BAR = 13;
  60.    static var NUM_CONTROLS = 14;
  61.    static var UP_STATE = 0;
  62.    static var OVER_STATE = 1;
  63.    static var DOWN_STATE = 2;
  64.    static var SKIN_AUTO_HIDE_INTERVAL = 200;
  65.    static var VOLUME_BAR_INTERVAL_DEFAULT = 250;
  66.    static var VOLUME_BAR_SCRUB_TOLERANCE_DEFAULT = 0;
  67.    static var SEEK_BAR_INTERVAL_DEFAULT = 250;
  68.    static var SEEK_BAR_SCRUB_TOLERANCE_DEFAULT = 5;
  69.    static var BUFFERING_DELAY_INTERVAL_DEFAULT = 1000;
  70.    function UIManager(vc)
  71.    {
  72.       this._vc = vc;
  73.       this._skin = undefined;
  74.       this._skinAutoHide = false;
  75.       this._skinReady = true;
  76.       this.__visible = true;
  77.       this._bufferingBarHides = false;
  78.       this._controlsEnabled = true;
  79.       this._lastScrubPos = 0;
  80.       this._lastVolumePos = 0;
  81.       this.cachedSoundLevel = this._vc.volume;
  82.       this._isMuted = false;
  83.       this.controls = new Array();
  84.       this.customClips = undefined;
  85.       this.skin_mc = undefined;
  86.       this.skinLoader = undefined;
  87.       this.layout_mc = undefined;
  88.       this.border_mc = undefined;
  89.       this._seekBarIntervalID = 0;
  90.       this._seekBarInterval = mx.video.UIManager.SEEK_BAR_INTERVAL_DEFAULT;
  91.       this._seekBarScrubTolerance = mx.video.UIManager.SEEK_BAR_SCRUB_TOLERANCE_DEFAULT;
  92.       this._volumeBarIntervalID = 0;
  93.       this._volumeBarInterval = mx.video.UIManager.VOLUME_BAR_INTERVAL_DEFAULT;
  94.       this._volumeBarScrubTolerance = mx.video.UIManager.VOLUME_BAR_SCRUB_TOLERANCE_DEFAULT;
  95.       this._bufferingDelayIntervalID = 0;
  96.       this._bufferingDelayInterval = mx.video.UIManager.BUFFERING_DELAY_INTERVAL_DEFAULT;
  97.       this._bufferingOn = false;
  98.       this._skinAutoHideIntervalID = 0;
  99.       this._vc.addEventListener("metadataReceived",this);
  100.       this._vc.addEventListener("playheadUpdate",this);
  101.       this._vc.addEventListener("progress",this);
  102.       this._vc.addEventListener("stateChange",this);
  103.       this._vc.addEventListener("ready",this);
  104.       this._vc.addEventListener("resize",this);
  105.       this._vc.addEventListener("volumeUpdate",this);
  106.    }
  107.    function handleEvent(e)
  108.    {
  109.       if(e.vp != undefined && e.vp != this._vc.visibleVideoPlayerIndex)
  110.       {
  111.          return undefined;
  112.       }
  113.       var _loc9_ = this._vc.activeVideoPlayerIndex;
  114.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  115.       if(e.type == "stateChange")
  116.       {
  117.          if(e.state == mx.video.FLVPlayback.BUFFERING)
  118.          {
  119.             if(!this._bufferingOn)
  120.             {
  121.                clearInterval(this._bufferingDelayIntervalID);
  122.                this._bufferingDelayIntervalID = setInterval(this,"doBufferingDelay",this._bufferingDelayInterval);
  123.             }
  124.          }
  125.          else
  126.          {
  127.             clearInterval(this._bufferingDelayIntervalID);
  128.             this._bufferingDelayIntervalID = 0;
  129.             this._bufferingOn = false;
  130.          }
  131.          if(e.state == mx.video.FLVPlayback.LOADING)
  132.          {
  133.             this._progressPercent = !this._vc.getVideoPlayer(e.vp).isRTMP ? 0 : 100;
  134.             var _loc2_ = mx.video.UIManager.SEEK_BAR;
  135.             while(_loc2_ <= mx.video.UIManager.VOLUME_BAR)
  136.             {
  137.                var _loc4_ = this.controls[_loc2_];
  138.                if(_loc4_.progress_mc != undefined)
  139.                {
  140.                   this.positionBar(_loc4_,"progress",this._progressPercent);
  141.                }
  142.                _loc2_ = _loc2_ + 1;
  143.             }
  144.          }
  145.          _loc2_ = 0;
  146.          while(_loc2_ < mx.video.UIManager.NUM_CONTROLS)
  147.          {
  148.             if(this.controls[_loc2_] != undefined)
  149.             {
  150.                this.setEnabledAndVisibleForState(_loc2_,e.state);
  151.                if(_loc2_ < mx.video.UIManager.NUM_BUTTONS)
  152.                {
  153.                   this.skinButtonControl(this.controls[_loc2_]);
  154.                }
  155.             }
  156.             _loc2_ = _loc2_ + 1;
  157.          }
  158.       }
  159.       else if(e.type == "ready" || e.type == "metadataReceived")
  160.       {
  161.          _loc2_ = 0;
  162.          while(_loc2_ < mx.video.UIManager.NUM_CONTROLS)
  163.          {
  164.             if(this.controls[_loc2_] != undefined)
  165.             {
  166.                this.setEnabledAndVisibleForState(_loc2_,this._vc.state);
  167.                if(_loc2_ < mx.video.UIManager.NUM_BUTTONS)
  168.                {
  169.                   this.skinButtonControl(this.controls[_loc2_]);
  170.                }
  171.             }
  172.             _loc2_ = _loc2_ + 1;
  173.          }
  174.          if(this._vc.getVideoPlayer(e.vp).isRTMP)
  175.          {
  176.             this._progressPercent = 100;
  177.             _loc2_ = mx.video.UIManager.SEEK_BAR;
  178.             while(_loc2_ <= mx.video.UIManager.VOLUME_BAR)
  179.             {
  180.                _loc4_ = this.controls[_loc2_];
  181.                if(_loc4_.progress_mc != undefined)
  182.                {
  183.                   this.positionBar(_loc4_,"progress",this._progressPercent);
  184.                }
  185.                _loc2_ = _loc2_ + 1;
  186.             }
  187.          }
  188.       }
  189.       else if(e.type == "resize")
  190.       {
  191.          this.layoutSkin();
  192.          this.setupSkinAutoHide();
  193.       }
  194.       else if(e.type == "volumeUpdate")
  195.       {
  196.          if(this._isMuted && e.volume > 0)
  197.          {
  198.             this._isMuted = false;
  199.             this.setEnabledAndVisibleForState(mx.video.UIManager.MUTE_OFF_BUTTON,mx.video.FLVPlayback.PLAYING);
  200.             this.skinButtonControl(this.controls[mx.video.UIManager.MUTE_OFF_BUTTON]);
  201.             this.setEnabledAndVisibleForState(mx.video.UIManager.MUTE_ON_BUTTON,mx.video.FLVPlayback.PLAYING);
  202.             this.skinButtonControl(this.controls[mx.video.UIManager.MUTE_ON_BUTTON]);
  203.          }
  204.          var _loc5_ = this.controls[mx.video.UIManager.VOLUME_BAR];
  205.          _loc5_.percentage = !this._isMuted ? e.volume : this.cachedSoundLevel;
  206.          if(_loc5_.percentage < 0)
  207.          {
  208.             _loc5_.percentage = 0;
  209.          }
  210.          else if(_loc5_.percentage > 100)
  211.          {
  212.             _loc5_.percentage = 100;
  213.          }
  214.          this.positionHandle(mx.video.UIManager.VOLUME_BAR);
  215.       }
  216.       else if(e.type == "playheadUpdate" && this.controls[mx.video.UIManager.SEEK_BAR] != undefined)
  217.       {
  218.          if(!this._vc.isLive && this._vc.totalTime > 0)
  219.          {
  220.             var _loc6_ = e.playheadTime / this._vc.totalTime * 100;
  221.             if(_loc6_ < 0)
  222.             {
  223.                _loc6_ = 0;
  224.             }
  225.             else if(_loc6_ > 100)
  226.             {
  227.                _loc6_ = 100;
  228.             }
  229.             var _loc10_ = this.controls[mx.video.UIManager.SEEK_BAR];
  230.             _loc10_.percentage = _loc6_;
  231.             this.positionHandle(mx.video.UIManager.SEEK_BAR);
  232.          }
  233.       }
  234.       else if(e.type == "progress")
  235.       {
  236.          this._progressPercent = e.bytesTotal > 0 ? e.bytesLoaded / e.bytesTotal * 100 : 100;
  237.          var _loc7_ = this._vc._vpState[e.vp].minProgressPercent;
  238.          if(!isNaN(_loc7_) && _loc7_ > this._progressPercent)
  239.          {
  240.             this._progressPercent = _loc7_;
  241.          }
  242.          if(this._vc.totalTime > 0)
  243.          {
  244.             var _loc8_ = this._vc.playheadTime / this._vc.totalTime * 100;
  245.             if(_loc8_ > this._progressPercent)
  246.             {
  247.                this._progressPercent = _loc8_;
  248.                this._vc._vpState[e.vp].minProgressPercent = this._progressPercent;
  249.             }
  250.          }
  251.          _loc2_ = mx.video.UIManager.SEEK_BAR;
  252.          while(_loc2_ <= mx.video.UIManager.VOLUME_BAR)
  253.          {
  254.             _loc4_ = this.controls[_loc2_];
  255.             if(_loc4_.progress_mc != undefined)
  256.             {
  257.                this.positionBar(_loc4_,"progress",this._progressPercent);
  258.             }
  259.             _loc2_ = _loc2_ + 1;
  260.          }
  261.       }
  262.       this._vc.activeVideoPlayerIndex = _loc9_;
  263.    }
  264.    function get bufferingBarHidesAndDisablesOthers()
  265.    {
  266.       return this._bufferingBarHides;
  267.    }
  268.    function set bufferingBarHidesAndDisablesOthers(b)
  269.    {
  270.       this._bufferingBarHides = b;
  271.    }
  272.    function get controlsEnabled()
  273.    {
  274.       return this._controlsEnabled;
  275.    }
  276.    function set controlsEnabled(flag)
  277.    {
  278.       if(this._controlsEnabled == flag)
  279.       {
  280.          return;
  281.       }
  282.       this._controlsEnabled = flag;
  283.       var _loc2_ = 0;
  284.       while(_loc2_ < mx.video.UIManager.NUM_BUTTONS)
  285.       {
  286.          if(this.controls[_loc2_] != undefined)
  287.          {
  288.             this.controls[_loc2_].releaseCapture();
  289.             this.controls[_loc2_].enabled = this._controlsEnabled && this.controls[_loc2_].myEnabled;
  290.             this.skinButtonControl(this.controls[_loc2_]);
  291.          }
  292.          _loc2_ = _loc2_ + 1;
  293.       }
  294.    }
  295.    function get skin()
  296.    {
  297.       return this._skin;
  298.    }
  299.    function set skin(s)
  300.    {
  301.       if(s == this._skin)
  302.       {
  303.          return;
  304.       }
  305.       if(this._skin != undefined)
  306.       {
  307.          this.removeSkin();
  308.       }
  309.       this._skin = s;
  310.       this._skinReady = this._skin == undefined || this._skin == null || this._skin == "";
  311.       if(!this._skinReady)
  312.       {
  313.          this.downloadSkin();
  314.       }
  315.    }
  316.    function get skinAutoHide()
  317.    {
  318.       return this._skinAutoHide;
  319.    }
  320.    function set skinAutoHide(b)
  321.    {
  322.       if(b == this._skinAutoHide)
  323.       {
  324.          return;
  325.       }
  326.       this._skinAutoHide = b;
  327.       this.setupSkinAutoHide();
  328.    }
  329.    function get skinReady()
  330.    {
  331.       return this._skinReady;
  332.    }
  333.    function get seekBarInterval()
  334.    {
  335.       return this._seekBarInterval;
  336.    }
  337.    function set seekBarInterval(s)
  338.    {
  339.       if(this._seekBarInterval == s)
  340.       {
  341.          return;
  342.       }
  343.       this._seekBarInterval = s;
  344.       if(this._seekBarIntervalID > 0)
  345.       {
  346.          clearInterval(this._seekBarIntervalID);
  347.          this._seekBarIntervalID = setInterval(this,"seekBarListener",this._seekBarInterval,false);
  348.       }
  349.    }
  350.    function get volumeBarInterval()
  351.    {
  352.       return this._volumeBarInterval;
  353.    }
  354.    function set volumeBarInterval(s)
  355.    {
  356.       if(this._volumeBarInterval == s)
  357.       {
  358.          return;
  359.       }
  360.       this._volumeBarInterval = s;
  361.       if(this._volumeBarIntervalID > 0)
  362.       {
  363.          clearInterval(this._volumeBarIntervalID);
  364.          this._volumeBarIntervalID = setInterval(this,"volumeBarListener",this._volumeBarInterval,false);
  365.       }
  366.    }
  367.    function get bufferingDelayInterval()
  368.    {
  369.       return this._bufferingDelayInterval;
  370.    }
  371.    function set bufferingDelayInterval(s)
  372.    {
  373.       if(this._bufferingDelayInterval == s)
  374.       {
  375.          return;
  376.       }
  377.       this._bufferingDelayInterval = s;
  378.       if(this._bufferingDelayIntervalID > 0)
  379.       {
  380.          clearInterval(this._bufferingDelayIntervalID);
  381.          this._bufferingDelayIntervalID = setInterval(this,"doBufferingDelay",this._bufferingDelayIntervalID);
  382.       }
  383.    }
  384.    function get volumeBarScrubTolerance()
  385.    {
  386.       return this._volumeBarScrubTolerance;
  387.    }
  388.    function set volumeBarScrubTolerance(s)
  389.    {
  390.       this._volumeBarScrubTolerance = s;
  391.    }
  392.    function get seekBarScrubTolerance()
  393.    {
  394.       return this._seekBarScrubTolerance;
  395.    }
  396.    function set seekBarScrubTolerance(s)
  397.    {
  398.       this._seekBarScrubTolerance = s;
  399.    }
  400.    function get visible()
  401.    {
  402.       return this.__visible;
  403.    }
  404.    function set visible(v)
  405.    {
  406.       if(this.__visible == v)
  407.       {
  408.          return;
  409.       }
  410.       this.__visible = v;
  411.       if(!this.__visible)
  412.       {
  413.          this.skin_mc._visible = false;
  414.       }
  415.       else
  416.       {
  417.          this.setupSkinAutoHide();
  418.       }
  419.    }
  420.    function getControl(index)
  421.    {
  422.       return this.controls[index];
  423.    }
  424.    function setControl(index, s)
  425.    {
  426.       if(s == null)
  427.       {
  428.          s = undefined;
  429.       }
  430.       if(s == this.controls[index])
  431.       {
  432.          return undefined;
  433.       }
  434.       switch(index)
  435.       {
  436.          case mx.video.UIManager.PAUSE_BUTTON:
  437.          case mx.video.UIManager.PLAY_BUTTON:
  438.             this.resetPlayPause();
  439.             break;
  440.          case mx.video.UIManager.PLAY_PAUSE_BUTTON:
  441.             if(s._parent != this.layout_mc)
  442.             {
  443.                this.resetPlayPause();
  444.                this.setControl(mx.video.UIManager.PAUSE_BUTTON,s.pause_mc);
  445.                this.setControl(mx.video.UIManager.PLAY_BUTTON,s.play_mc);
  446.             }
  447.             break;
  448.          case mx.video.UIManager.MUTE_BUTTON:
  449.             if(s._parent != this.layout_mc)
  450.             {
  451.                this.setControl(mx.video.UIManager.MUTE_ON_BUTTON,s.on_mc);
  452.                this.setControl(mx.video.UIManager.MUTE_OFF_BUTTON,s.off_mc);
  453.             }
  454.       }
  455.       if(index >= mx.video.UIManager.NUM_BUTTONS)
  456.       {
  457.          this.controls[index] = s;
  458.          switch(index)
  459.          {
  460.             case mx.video.UIManager.SEEK_BAR:
  461.                this.addBarControl(mx.video.UIManager.SEEK_BAR);
  462.                break;
  463.             case mx.video.UIManager.VOLUME_BAR:
  464.                this.addBarControl(mx.video.UIManager.VOLUME_BAR);
  465.                this.controls[mx.video.UIManager.VOLUME_BAR].percentage = this._vc.volume;
  466.                break;
  467.             case mx.video.UIManager.BUFFERING_BAR:
  468.                this.controls[mx.video.UIManager.BUFFERING_BAR].uiMgr = this;
  469.                this.controls[mx.video.UIManager.BUFFERING_BAR].controlIndex = mx.video.UIManager.BUFFERING_BAR;
  470.                if(this.controls[mx.video.UIManager.BUFFERING_BAR]._parent == this.skin_mc)
  471.                {
  472.                   this.finishAddBufferingBar();
  473.                }
  474.                else
  475.                {
  476.                   this.controls[mx.video.UIManager.BUFFERING_BAR].onEnterFrame = function()
  477.                   {
  478.                      this.uiMgr.finishAddBufferingBar();
  479.                   };
  480.                }
  481.          }
  482.          this.setEnabledAndVisibleForState(index,this._vc.state);
  483.       }
  484.       else
  485.       {
  486.          this.removeButtonControl(index);
  487.          this.controls[index] = s;
  488.          this.addButtonControl(index);
  489.       }
  490.    }
  491.    function resetPlayPause()
  492.    {
  493.       if(this.controls[mx.video.UIManager.PLAY_PAUSE_BUTTON] == undefined)
  494.       {
  495.          return undefined;
  496.       }
  497.       var _loc2_ = mx.video.UIManager.PAUSE_BUTTON;
  498.       while(_loc2_ <= mx.video.UIManager.PLAY_BUTTON)
  499.       {
  500.          this.removeButtonControl(_loc2_);
  501.          _loc2_ = _loc2_ + 1;
  502.       }
  503.       this.controls[mx.video.UIManager.PLAY_PAUSE_BUTTON] = undefined;
  504.    }
  505.    function addButtonControl(index)
  506.    {
  507.       var _loc3_ = this.controls[index];
  508.       if(_loc3_ == undefined)
  509.       {
  510.          return undefined;
  511.       }
  512.       var _loc5_ = this._vc.activeVideoPlayerIndex;
  513.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  514.       _loc3_.id = index;
  515.       _loc3_.state = mx.video.UIManager.UP_STATE;
  516.       _loc3_.uiMgr = this;
  517.       this.setEnabledAndVisibleForState(index,this._vc.state);
  518.       _loc3_.onRollOver = function()
  519.       {
  520.          this.state = mx.video.UIManager.OVER_STATE;
  521.          this.uiMgr.skinButtonControl(this);
  522.       };
  523.       _loc3_.onRollOut = function()
  524.       {
  525.          this.state = mx.video.UIManager.UP_STATE;
  526.          this.uiMgr.skinButtonControl(this);
  527.       };
  528.       if(index == mx.video.UIManager.SEEK_BAR_HANDLE || index == mx.video.UIManager.VOLUME_BAR_HANDLE)
  529.       {
  530.          _loc3_.onPress = function()
  531.          {
  532.             if(_root.focusManager)
  533.             {
  534.                this._focusrect = false;
  535.                Selection.setFocus(this);
  536.             }
  537.             this.state = mx.video.UIManager.DOWN_STATE;
  538.             this.uiMgr.dispatchMessage(this);
  539.             this.uiMgr.skinButtonControl(this);
  540.          };
  541.          _loc3_.onRelease = function()
  542.          {
  543.             this.state = mx.video.UIManager.OVER_STATE;
  544.             this.uiMgr.handleRelease(this.controlIndex);
  545.             this.uiMgr.skinButtonControl(this);
  546.          };
  547.          _loc3_.onReleaseOutside = function()
  548.          {
  549.             this.state = mx.video.UIManager.UP_STATE;
  550.             this.uiMgr.handleRelease(this.controlIndex);
  551.             this.uiMgr.skinButtonControl(this);
  552.          };
  553.       }
  554.       else
  555.       {
  556.          _loc3_.onPress = function()
  557.          {
  558.             if(_root.focusManager)
  559.             {
  560.                this._focusrect = false;
  561.                Selection.setFocus(this);
  562.             }
  563.             this.state = mx.video.UIManager.DOWN_STATE;
  564.             this.uiMgr.skinButtonControl(this);
  565.          };
  566.          _loc3_.onRelease = function()
  567.          {
  568.             this.state = mx.video.UIManager.OVER_STATE;
  569.             this.uiMgr.dispatchMessage(this);
  570.             this.uiMgr.skinButtonControl(this);
  571.          };
  572.          _loc3_.onReleaseOutside = function()
  573.          {
  574.             this.state = mx.video.UIManager.UP_STATE;
  575.             this.uiMgr.skinButtonControl(this);
  576.          };
  577.       }
  578.       if(_loc3_._parent == this.skin_mc)
  579.       {
  580.          this.skinButtonControl(_loc3_);
  581.       }
  582.       else
  583.       {
  584.          _loc3_.onEnterFrame = function()
  585.          {
  586.             this.uiMgr.skinButtonControl(this);
  587.          };
  588.       }
  589.       this._vc.activeVideoPlayerIndex = _loc5_;
  590.    }
  591.    function removeButtonControl(index)
  592.    {
  593.       if(this.controls[index] == undefined)
  594.       {
  595.          return undefined;
  596.       }
  597.       this.controls[index].uiMgr = undefined;
  598.       this.controls[index].onRollOver = undefined;
  599.       this.controls[index].onRollOut = undefined;
  600.       this.controls[index].onPress = undefined;
  601.       this.controls[index].onRelease = undefined;
  602.       this.controls[index].onReleaseOutside = undefined;
  603.       this.controls[index] = undefined;
  604.    }
  605.    function downloadSkin()
  606.    {
  607.       if(this.skinLoader == undefined)
  608.       {
  609.          this.skinLoader = new MovieClipLoader();
  610.          this.skinLoader.addListener(this);
  611.       }
  612.       if(this.skin_mc == undefined)
  613.       {
  614.          this.skin_mc = this._vc.createEmptyMovieClip("skin_mc",this._vc.getNextHighestDepth());
  615.       }
  616.       this.skin_mc._visible = false;
  617.       this.skin_mc._x = Stage.width + 100;
  618.       this.skin_mc._y = Stage.height + 100;
  619.       this.skinLoader.loadClip(this._skin,this.skin_mc);
  620.    }
  621.    function onLoadError(target_mc, errorCode)
  622.    {
  623.       this._skinReady = true;
  624.       this._vc.skinError("Unable to load skin swf");
  625.    }
  626.    function onLoadInit()
  627.    {
  628.       try
  629.       {
  630.          this.skin_mc._visible = false;
  631.          this.skin_mc._x = 0;
  632.          this.skin_mc._y = 0;
  633.          this.layout_mc = this.skin_mc.layout_mc;
  634.          if(this.layout_mc == undefined)
  635.          {
  636.             throw new Error("No layout_mc");
  637.          }
  638.          this.layout_mc._visible = false;
  639.          this.customClips = new Array();
  640.          this.setCustomClips("bg");
  641.          if(this.layout_mc.playpause_mc != undefined)
  642.          {
  643.             this.setSkin(mx.video.UIManager.PLAY_PAUSE_BUTTON,this.layout_mc.playpause_mc);
  644.          }
  645.          else
  646.          {
  647.             this.setSkin(mx.video.UIManager.PAUSE_BUTTON,this.layout_mc.pause_mc);
  648.             this.setSkin(mx.video.UIManager.PLAY_BUTTON,this.layout_mc.play_mc);
  649.          }
  650.          this.setSkin(mx.video.UIManager.STOP_BUTTON,this.layout_mc.stop_mc);
  651.          this.setSkin(mx.video.UIManager.BACK_BUTTON,this.layout_mc.back_mc);
  652.          this.setSkin(mx.video.UIManager.FORWARD_BUTTON,this.layout_mc.forward_mc);
  653.          this.setSkin(mx.video.UIManager.MUTE_BUTTON,this.layout_mc.volumeMute_mc);
  654.          this.setSkin(mx.video.UIManager.SEEK_BAR,this.layout_mc.seekBar_mc);
  655.          this.setSkin(mx.video.UIManager.VOLUME_BAR,this.layout_mc.volumeBar_mc);
  656.          this.setSkin(mx.video.UIManager.BUFFERING_BAR,this.layout_mc.bufferingBar_mc);
  657.          this.setCustomClips("fg");
  658.          this.layoutSkin();
  659.          this.setupSkinAutoHide();
  660.          this.skin_mc._visible = this.__visible;
  661.          this._skinReady = true;
  662.          this._vc.skinLoaded();
  663.          var _loc4_ = this._vc.activeVideoPlayerIndex;
  664.          this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  665.          var _loc3_ = this._vc.state;
  666.          var _loc2_ = 0;
  667.          while(_loc2_ < mx.video.UIManager.NUM_CONTROLS)
  668.          {
  669.             if(this.controls[_loc2_] != undefined)
  670.             {
  671.                this.setEnabledAndVisibleForState(_loc2_,_loc3_);
  672.                if(_loc2_ < mx.video.UIManager.NUM_BUTTONS)
  673.                {
  674.                   this.skinButtonControl(this.controls[_loc2_]);
  675.                }
  676.             }
  677.             _loc2_ = _loc2_ + 1;
  678.          }
  679.          this._vc.activeVideoPlayerIndex = _loc4_;
  680.       }
  681.       catch(err:Error)
  682.       {
  683.          this._vc.skinError(err.message);
  684.          this.removeSkin();
  685.       }
  686.    }
  687.    function layoutSkin()
  688.    {
  689.       if(this.layout_mc == undefined)
  690.       {
  691.          return undefined;
  692.       }
  693.       var _loc3_ = this.layout_mc.video_mc;
  694.       if(_loc3_ == undefined)
  695.       {
  696.          throw new Error("No layout_mc.video_mc");
  697.       }
  698.       this.placeholderLeft = _loc3_._x;
  699.       this.placeholderRight = _loc3_._x + _loc3_._width;
  700.       this.placeholderTop = _loc3_._y;
  701.       this.placeholderBottom = _loc3_._y + _loc3_._height;
  702.       this.videoLeft = 0;
  703.       this.videoRight = this._vc.width;
  704.       this.videoTop = 0;
  705.       this.videoBottom = this._vc.height;
  706.       if(!isNaN(this.layout_mc.minWidth) && this.layout_mc.minWidth > 0 && this.layout_mc.minWidth > this.videoRight)
  707.       {
  708.          this.videoLeft -= (this.layout_mc.minWidth - this.videoRight) / 2;
  709.          this.videoRight = this.layout_mc.minWidth + this.videoLeft;
  710.       }
  711.       if(!isNaN(this.layout_mc.minHeight) && this.layout_mc.minHeight > 0 && this.layout_mc.minHeight > this.videoBottom)
  712.       {
  713.          this.videoTop -= (this.layout_mc.minHeight - this.videoBottom) / 2;
  714.          this.videoBottom = this.layout_mc.minHeight + this.videoTop;
  715.       }
  716.       var _loc2_ = undefined;
  717.       _loc2_ = 0;
  718.       while(_loc2_ < this.customClips.length)
  719.       {
  720.          this.layoutControl(this.customClips[_loc2_]);
  721.          _loc2_ = _loc2_ + 1;
  722.       }
  723.       _loc2_ = 0;
  724.       while(_loc2_ < mx.video.UIManager.NUM_CONTROLS)
  725.       {
  726.          this.layoutControl(this.controls[_loc2_]);
  727.          _loc2_ = _loc2_ + 1;
  728.       }
  729.    }
  730.    function layoutControl(ctrl)
  731.    {
  732.       if(ctrl == undefined)
  733.       {
  734.          return undefined;
  735.       }
  736.       if(ctrl.skin.anchorRight)
  737.       {
  738.          if(ctrl.skin.anchorLeft)
  739.          {
  740.             ctrl._x = ctrl.skin._x - this.placeholderLeft + this.videoLeft;
  741.             ctrl._width = ctrl.skin._x + ctrl.skin._width - this.placeholderRight + this.videoRight - ctrl._x;
  742.             if(ctrl.origWidth != undefined)
  743.             {
  744.                ctrl.origWidth = undefined;
  745.             }
  746.          }
  747.          else
  748.          {
  749.             ctrl._x = ctrl.skin._x - this.placeholderRight + this.videoRight;
  750.          }
  751.       }
  752.       else
  753.       {
  754.          ctrl._x = ctrl.skin._x - this.placeholderLeft + this.videoLeft;
  755.       }
  756.       if(ctrl.skin.anchorTop)
  757.       {
  758.          if(ctrl.skin.anchorBottom)
  759.          {
  760.             ctrl._y = ctrl.skin._y - this.placeholderTop + this.videoTop;
  761.             ctrl._height = ctrl.skin._y + ctrl.skin._height - this.placeholderBottom + this.videoBottom - ctrl._y;
  762.             if(ctrl.origHeight != undefined)
  763.             {
  764.                ctrl.origHeight = undefined;
  765.             }
  766.          }
  767.          else
  768.          {
  769.             ctrl._y = ctrl.skin._y - this.placeholderTop + this.videoTop;
  770.          }
  771.       }
  772.       else
  773.       {
  774.          ctrl._y = ctrl.skin._y - this.placeholderBottom + this.videoBottom;
  775.       }
  776.       switch(ctrl.controlIndex)
  777.       {
  778.          case mx.video.UIManager.SEEK_BAR:
  779.          case mx.video.UIManager.VOLUME_BAR:
  780.             if(ctrl.progress_mc != undefined)
  781.             {
  782.                if(this._progressPercent == undefined)
  783.                {
  784.                   this._progressPercent = !this._vc.isRTMP ? 0 : 100;
  785.                }
  786.                this.positionBar(ctrl,"progress",this._progressPercent);
  787.             }
  788.             this.positionHandle(ctrl.controlIndex);
  789.             break;
  790.          case mx.video.UIManager.BUFFERING_BAR:
  791.             if(ctrl.fill_mc != undefined)
  792.             {
  793.                this.positionMaskedFill(ctrl,ctrl.fill_mc,100);
  794.             }
  795.       }
  796.       if(ctrl.layoutSelf != undefined)
  797.       {
  798.          ctrl.layoutSelf();
  799.       }
  800.    }
  801.    function removeSkin()
  802.    {
  803.       if(this.skin_mc != undefined)
  804.       {
  805.          var _loc2_ = 0;
  806.          while(_loc2_ < mx.video.UIManager.NUM_BUTTONS)
  807.          {
  808.             this.removeButtonControl(_loc2_);
  809.             _loc2_ = _loc2_ + 1;
  810.          }
  811.          _loc2_ = mx.video.UIManager.NUM_BUTTONS;
  812.          while(_loc2_ < mx.video.UIManager.NUM_CONTROLS)
  813.          {
  814.             this.controls[_loc2_] = undefined;
  815.             _loc2_ = _loc2_ + 1;
  816.          }
  817.          this.skin_mc.unloadMovie();
  818.          this.layout_mc = undefined;
  819.          this.border_mc = undefined;
  820.       }
  821.    }
  822.    function setCustomClips(prefix)
  823.    {
  824.       var _loc4_ = 1;
  825.       while(true)
  826.       {
  827.          var _loc2_ = this.layout_mc[prefix + _loc4_++ + "_mc"];
  828.          if(_loc2_ == undefined)
  829.          {
  830.             break;
  831.          }
  832.          var _loc3_ = _loc2_.mc;
  833.          if(_loc3_ == undefined)
  834.          {
  835.             _loc3_ = _loc2_._parent._parent[_loc2_._name];
  836.          }
  837.          if(_loc3_ == undefined)
  838.          {
  839.             throw new Error("Bad clip in skin: " + _loc2_);
  840.          }
  841.          _loc3_.skin = _loc2_;
  842.          this.customClips.push(_loc3_);
  843.          if(prefix == "bg" && _loc4_ == 2)
  844.          {
  845.             this.border_mc = _loc3_;
  846.          }
  847.       }
  848.    }
  849.    function setSkin(index, s)
  850.    {
  851.       if(s == undefined)
  852.       {
  853.          return undefined;
  854.       }
  855.       var _loc2_ = s.mc;
  856.       if(_loc2_ == undefined)
  857.       {
  858.          _loc2_ = s._parent._parent[s._name];
  859.       }
  860.       if(_loc2_ == undefined)
  861.       {
  862.          throw new Error("Bad clip in skin: " + s);
  863.       }
  864.       _loc2_.skin = s;
  865.       if(index < mx.video.UIManager.NUM_BUTTONS)
  866.       {
  867.          this.setupSkinStates(_loc2_);
  868.       }
  869.       else
  870.       {
  871.          switch(index)
  872.          {
  873.             case mx.video.UIManager.PLAY_PAUSE_BUTTON:
  874.                this.setupSkinStates(_loc2_.play_mc);
  875.                this.setupSkinStates(_loc2_.pause_mc);
  876.                break;
  877.             case mx.video.UIManager.MUTE_BUTTON:
  878.                this.setupSkinStates(_loc2_.on_mc);
  879.                this.setupSkinStates(_loc2_.off_mc);
  880.                break;
  881.             case mx.video.UIManager.SEEK_BAR:
  882.             case mx.video.UIManager.VOLUME_BAR:
  883.                var _loc4_ = index != mx.video.UIManager.SEEK_BAR ? "volumeBar" : "seekBar";
  884.                if(_loc2_.handle_mc == undefined)
  885.                {
  886.                   _loc2_.handle_mc = _loc2_.skin.seekBarHandle_mc;
  887.                   if(_loc2_.handle_mc == undefined)
  888.                   {
  889.                      _loc2_.handle_mc = _loc2_.skin._parent._parent[_loc4_ + "Handle_mc"];
  890.                   }
  891.                }
  892.                if(_loc2_.progress_mc == undefined)
  893.                {
  894.                   _loc2_.progress_mc = _loc2_.skin.progress_mc;
  895.                   if(_loc2_.progress_mc == undefined)
  896.                   {
  897.                      _loc2_.progress_mc = _loc2_.skin._parent._parent[_loc4_ + "Progress_mc"];
  898.                   }
  899.                }
  900.                if(_loc2_.fullness_mc == undefined)
  901.                {
  902.                   _loc2_.fullness_mc = _loc2_.skin.fullness_mc;
  903.                   if(_loc2_.fullness_mc == undefined)
  904.                   {
  905.                      _loc2_.fullness_mc = _loc2_.skin._parent._parent[_loc4_ + "Fullness_mc"];
  906.                   }
  907.                }
  908.                break;
  909.             case mx.video.UIManager.BUFFERING_BAR:
  910.                if(_loc2_.fill_mc == undefined)
  911.                {
  912.                   _loc2_.fill_mc = _loc2_.skin.fill_mc;
  913.                   if(_loc2_.fill_mc == undefined)
  914.                   {
  915.                      _loc2_.fill_mc = _loc2_.skin._parent._parent.bufferingBarFill_mc;
  916.                   }
  917.                }
  918.          }
  919.       }
  920.       this.setControl(index,_loc2_);
  921.    }
  922.    function setupSkinStates(ctrl)
  923.    {
  924.       if(ctrl.up_mc == undefined)
  925.       {
  926.          ctrl.up_mc = ctrl;
  927.          ctrl.over_mc = ctrl;
  928.          ctrl.down_mc = ctrl;
  929.          ctrl.disabled_mc = ctrl;
  930.       }
  931.       else
  932.       {
  933.          ctrl._x = 0;
  934.          ctrl._y = 0;
  935.          ctrl.up_mc._x = 0;
  936.          ctrl.up_mc._y = 0;
  937.          ctrl.up_mc._visible = true;
  938.          if(ctrl.over_mc == undefined)
  939.          {
  940.             ctrl.over_mc = ctrl.up_mc;
  941.          }
  942.          else
  943.          {
  944.             ctrl.over_mc._x = 0;
  945.             ctrl.over_mc._y = 0;
  946.             ctrl.over_mc._visible = false;
  947.          }
  948.          if(ctrl.down_mc == undefined)
  949.          {
  950.             ctrl.down_mc = ctrl.up_mc;
  951.          }
  952.          else
  953.          {
  954.             ctrl.down_mc._x = 0;
  955.             ctrl.down_mc._y = 0;
  956.             ctrl.down_mc._visible = false;
  957.          }
  958.          if(ctrl.disabled_mc == undefined)
  959.          {
  960.             ctrl.disabled_mc_mc = ctrl.up_mc;
  961.          }
  962.          else
  963.          {
  964.             ctrl.disabled_mc._x = 0;
  965.             ctrl.disabled_mc._y = 0;
  966.             ctrl.disabled_mc._visible = false;
  967.          }
  968.       }
  969.    }
  970.    function skinButtonControl(ctrl)
  971.    {
  972.       if(ctrl.onEnterFrame != undefined)
  973.       {
  974.          delete ctrl.onEnterFrame;
  975.          ctrl.onEnterFrame = undefined;
  976.       }
  977.       if(ctrl.enabled)
  978.       {
  979.          switch(ctrl.state)
  980.          {
  981.             case mx.video.UIManager.UP_STATE:
  982.                if(ctrl.up_mc == undefined)
  983.                {
  984.                   ctrl.up_mc = ctrl.attachMovie(ctrl.upLinkageID,"up_mc",ctrl.getNextHighestDepth());
  985.                }
  986.                this.applySkinState(ctrl,ctrl.up_mc);
  987.                break;
  988.             case mx.video.UIManager.OVER_STATE:
  989.                if(ctrl.over_mc == undefined)
  990.                {
  991.                   if(ctrl.overLinkageID == undefined)
  992.                   {
  993.                      ctrl.over_mc = ctrl.up_mc;
  994.                   }
  995.                   else
  996.                   {
  997.                      ctrl.over_mc = ctrl.attachMovie(ctrl.overLinkageID,"over_mc",ctrl.getNextHighestDepth());
  998.                   }
  999.                }
  1000.                this.applySkinState(ctrl,ctrl.over_mc);
  1001.                break;
  1002.             case mx.video.UIManager.DOWN_STATE:
  1003.                if(ctrl.down_mc == undefined)
  1004.                {
  1005.                   if(ctrl.downLinkageID == undefined)
  1006.                   {
  1007.                      ctrl.down_mc = ctrl.up_mc;
  1008.                   }
  1009.                   else
  1010.                   {
  1011.                      ctrl.down_mc = ctrl.attachMovie(ctrl.downLinkageID,"down_mc",ctrl.getNextHighestDepth());
  1012.                   }
  1013.                }
  1014.                this.applySkinState(ctrl,ctrl.down_mc);
  1015.          }
  1016.       }
  1017.       else
  1018.       {
  1019.          ctrl.state = mx.video.UIManager.UP_STATE;
  1020.          if(ctrl.disabled_mc == undefined)
  1021.          {
  1022.             if(ctrl.disabledLinkageID == undefined)
  1023.             {
  1024.                ctrl.disabled_mc = ctrl.up_mc;
  1025.             }
  1026.             else
  1027.             {
  1028.                ctrl.disabled_mc = ctrl.attachMovie(ctrl.disabledLinkageID,"disabled_mc",ctrl.getNextHighestDepth());
  1029.             }
  1030.          }
  1031.          this.applySkinState(ctrl,ctrl.disabled_mc);
  1032.       }
  1033.       if(ctrl.placeholder_mc != undefined)
  1034.       {
  1035.          ctrl.placeholder_mc.unloadMovie();
  1036.          delete ctrl.placeholder_mc;
  1037.          ctrl.placeholder_mc = undefined;
  1038.       }
  1039.    }
  1040.    function applySkinState(ctrl, state)
  1041.    {
  1042.       if(state != ctrl.currentState_mc)
  1043.       {
  1044.          if(state != undefined)
  1045.          {
  1046.             state._visible = true;
  1047.          }
  1048.          if(ctrl.currentState_mc != undefined)
  1049.          {
  1050.             ctrl.currentState_mc._visible = false;
  1051.          }
  1052.          ctrl.currentState_mc = state;
  1053.       }
  1054.    }
  1055.    function addBarControl(controlIndex)
  1056.    {
  1057.       var _loc2_ = this.controls[controlIndex];
  1058.       _loc2_.isDragging = false;
  1059.       _loc2_.percentage = 0;
  1060.       _loc2_.uiMgr = this;
  1061.       _loc2_.controlIndex = controlIndex;
  1062.       if(_loc2_._parent == this.skin_mc)
  1063.       {
  1064.          this.finishAddBarControl(controlIndex);
  1065.       }
  1066.       else
  1067.       {
  1068.          _loc2_.onEnterFrame = function()
  1069.          {
  1070.             this.uiMgr.finishAddBarControl(this.controlIndex);
  1071.          };
  1072.       }
  1073.    }
  1074.    function finishAddBarControl(controlIndex)
  1075.    {
  1076.       var _loc2_ = this.controls[controlIndex];
  1077.       delete _loc2_.onEnterFrame;
  1078.       _loc2_.onEnterFrame = undefined;
  1079.       if(_loc2_.addBarControl != undefined)
  1080.       {
  1081.          _loc2_.addBarControl();
  1082.       }
  1083.       this.calcBarMargins(_loc2_,"handle",true);
  1084.       this.calcBarMargins(_loc2_,"progress",false);
  1085.       this.calcBarMargins(_loc2_.progress_mc,"fill",false);
  1086.       this.calcBarMargins(_loc2_.progress_mc,"mask",false);
  1087.       this.calcBarMargins(_loc2_,"fullness",false);
  1088.       this.calcBarMargins(_loc2_.fullness_mc,"fill",false);
  1089.       this.calcBarMargins(_loc2_.fullness_mc,"mask",false);
  1090.       _loc2_.origWidth = _loc2_._width;
  1091.       _loc2_.origHeight = _loc2_._height;
  1092.       this.fixUpBar(_loc2_,"progress");
  1093.       if(_loc2_.progress_mc != undefined)
  1094.       {
  1095.          this.fixUpBar(_loc2_,"progressBarFill");
  1096.          if(this._progressPercent == undefined)
  1097.          {
  1098.             this._progressPercent = !this._vc.isRTMP ? 0 : 100;
  1099.          }
  1100.          this.positionBar(_loc2_,"progress",this._progressPercent);
  1101.       }
  1102.       this.fixUpBar(_loc2_,"fullness");
  1103.       if(_loc2_.fullness_mc != undefined)
  1104.       {
  1105.          this.fixUpBar(_loc2_,"fullnessBarFill");
  1106.       }
  1107.       this.fixUpBar(_loc2_,"handle");
  1108.       _loc2_.handle_mc.controlIndex = controlIndex;
  1109.       switch(controlIndex)
  1110.       {
  1111.          case mx.video.UIManager.SEEK_BAR:
  1112.             this.setControl(mx.video.UIManager.SEEK_BAR_HANDLE,_loc2_.handle_mc);
  1113.             break;
  1114.          case mx.video.UIManager.VOLUME_BAR:
  1115.             this.setControl(mx.video.UIManager.VOLUME_BAR_HANDLE,_loc2_.handle_mc);
  1116.       }
  1117.       this.positionHandle(controlIndex);
  1118.    }
  1119.    function fixUpBar(ctrl, type)
  1120.    {
  1121.       if(ctrl[type + "LinkageID"] != undefined && ctrl[type + "LinkageID"].length > 0)
  1122.       {
  1123.          var _loc1_ = undefined;
  1124.          if(ctrl[type + "Below"])
  1125.          {
  1126.             _loc1_ = -1;
  1127.             while(ctrl._parent.getInstanceAtDepth(_loc1_) != undefined)
  1128.             {
  1129.                _loc1_ = _loc1_ - 1;
  1130.             }
  1131.          }
  1132.          else
  1133.          {
  1134.             ctrl[type + "Below"] = false;
  1135.             _loc1_ = ctrl._parent.getNextHighestDepth();
  1136.          }
  1137.          ctrl[type + "_mc"] = ctrl._parent.attachMovie(ctrl[type + "LinkageID"],type + "_mc",_loc1_);
  1138.       }
  1139.    }
  1140.    function calcBarMargins(ctrl, type, symmetricMargins)
  1141.    {
  1142.       var _loc2_ = ctrl[type + "_mc"];
  1143.       if(_loc2_ == undefined)
  1144.       {
  1145.          return undefined;
  1146.       }
  1147.       if(ctrl[type + "LeftMargin"] == undefined && _loc2_._parent == ctrl._parent)
  1148.       {
  1149.          ctrl[type + "LeftMargin"] = _loc2_._x - ctrl._x;
  1150.       }
  1151.       if(ctrl[type + "RightMargin"] == undefined)
  1152.       {
  1153.          if(symmetricMargins)
  1154.          {
  1155.             ctrl[type + "RightMargin"] = ctrl[type + "LeftMargin"];
  1156.          }
  1157.          else if(_loc2_._parent == ctrl._parent)
  1158.          {
  1159.             ctrl[type + "RightMargin"] = ctrl._width - _loc2_._width - _loc2_._x + ctrl._x;
  1160.          }
  1161.       }
  1162.       if(ctrl[type + "TopMargin"] == undefined && _loc2_._parent == ctrl._parent)
  1163.       {
  1164.          ctrl[type + "TopMargin"] = _loc2_._y - ctrl._y;
  1165.       }
  1166.       if(ctrl[type + "BottomMargin"] == undefined)
  1167.       {
  1168.          if(symmetricMargins)
  1169.          {
  1170.             ctrl[type + "BottomMargin"] = ctrl[type + "TopMargin"];
  1171.          }
  1172.          else if(_loc2_._parent == ctrl._parent)
  1173.          {
  1174.             ctrl[type + "BottomMargin"] = ctrl._height - _loc2_._height - _loc2_._y + ctrl._y;
  1175.          }
  1176.       }
  1177.       if(ctrl[type + "X"] == undefined)
  1178.       {
  1179.          if(_loc2_._parent == ctrl._parent)
  1180.          {
  1181.             ctrl[type + "X"] = _loc2_._x - ctrl._x;
  1182.          }
  1183.          else if(_loc2_._parent == ctrl)
  1184.          {
  1185.             ctrl[type + "X"] = _loc2_._x;
  1186.          }
  1187.       }
  1188.       if(ctrl[type + "Y"] == undefined)
  1189.       {
  1190.          if(_loc2_._parent == ctrl._parent)
  1191.          {
  1192.             ctrl[type + "Y"] = _loc2_._y - ctrl._y;
  1193.          }
  1194.          else if(_loc2_._parent == ctrl)
  1195.          {
  1196.             ctrl[type + "Y"] = _loc2_._y;
  1197.          }
  1198.       }
  1199.       ctrl[type + "XScale"] = _loc2_._xscale;
  1200.       ctrl[type + "YScale"] = _loc2_._yscale;
  1201.       ctrl[type + "Width"] = _loc2_._width;
  1202.       ctrl[type + "Height"] = _loc2_._height;
  1203.    }
  1204.    function finishAddBufferingBar()
  1205.    {
  1206.       var _loc2_ = this.controls[mx.video.UIManager.BUFFERING_BAR];
  1207.       delete _loc2_.onEnterFrame;
  1208.       _loc2_.onEnterFrame = undefined;
  1209.       this.calcBarMargins(_loc2_,"fill",true);
  1210.       this.fixUpBar(_loc2_,"fill");
  1211.       if(_loc2_.fill_mc != undefined)
  1212.       {
  1213.          this.positionMaskedFill(_loc2_,_loc2_.fill_mc,100);
  1214.       }
  1215.    }
  1216.    function positionMaskedFill(ctrl, fill, percent)
  1217.    {
  1218.       var _loc5_ = fill._parent;
  1219.       var _loc3_ = ctrl.mask_mc;
  1220.       if(_loc3_ == undefined)
  1221.       {
  1222.          _loc3_ = _loc5_.createEmptyMovieClip(ctrl._name + "Mask_mc",_loc5_.getNextHighestDepth());
  1223.          ctrl.mask_mc = _loc3_;
  1224.          _loc3_.beginFill(16777215);
  1225.          _loc3_.lineTo(0,0);
  1226.          _loc3_.lineTo(1,0);
  1227.          _loc3_.lineTo(1,1);
  1228.          _loc3_.lineTo(0,1);
  1229.          _loc3_.lineTo(0,0);
  1230.          _loc3_.endFill();
  1231.          fill.setMask(_loc3_);
  1232.          _loc3_._x = ctrl.fillX;
  1233.          _loc3_._y = ctrl.fillY;
  1234.          _loc3_._width = ctrl.fillWidth;
  1235.          _loc3_._height = ctrl.fillHeight;
  1236.          _loc3_._visible = false;
  1237.          this.calcBarMargins(ctrl,"mask",true);
  1238.       }
  1239.       if(_loc5_ == ctrl)
  1240.       {
  1241.          if(fill.slideReveal)
  1242.          {
  1243.             fill._x = ctrl.maskX - ctrl.fillWidth + ctrl.fillWidth * percent / 100;
  1244.          }
  1245.          else
  1246.          {
  1247.             _loc3_._width = ctrl.fillWidth * percent / 100;
  1248.          }
  1249.       }
  1250.       else if(_loc5_ == ctrl._parent)
  1251.       {
  1252.          if(fill.slideReveal)
  1253.          {
  1254.             _loc3_._x = ctrl._x + ctrl.maskLeftMargin;
  1255.             _loc3_._y = ctrl._y + ctrl.maskTopMargin;
  1256.             _loc3_._width = ctrl._width - ctrl.maskRightMargin - ctrl.maskLeftMargin;
  1257.             _loc3_._height = ctrl._height - ctrl.maskTopMargin - ctrl.maskBottomMargin;
  1258.             fill._x = _loc3_._x - ctrl.fillWidth + ctrl.maskWidth * percent / 100;
  1259.             fill._y = ctrl._y + ctrl.fillTopMargin;
  1260.          }
  1261.          else
  1262.          {
  1263.             fill._x = ctrl._x + ctrl.fillLeftMargin;
  1264.             fill._y = ctrl._y + ctrl.fillTopMargin;
  1265.             _loc3_._x = fill._x;
  1266.             _loc3_._y = fill._y;
  1267.             _loc3_._width = (ctrl._width - ctrl.fillRightMargin - ctrl.fillLeftMargin) * percent / 100;
  1268.             _loc3_._height = ctrl._height - ctrl.fillTopMargin - ctrl.fillBottomMargin;
  1269.          }
  1270.       }
  1271.    }
  1272.    function startHandleDrag(controlIndex)
  1273.    {
  1274.       var _loc2_ = this.controls[controlIndex];
  1275.       var _loc5_ = _loc2_.handle_mc;
  1276.       if(_loc2_.startHandleDrag == undefined || !_loc2_.startHandleDrag())
  1277.       {
  1278.          var _loc3_ = _loc2_._y + _loc2_.handleY;
  1279.          var _loc4_ = _loc2_.origWidth != undefined ? _loc2_.origWidth : _loc2_._width;
  1280.          _loc5_.startDrag(false,_loc2_._x + _loc2_.handleLeftMargin,_loc3_,_loc2_._x + _loc4_ - _loc2_.handleRightMargin,_loc3_);
  1281.       }
  1282.       _loc2_.isDragging = true;
  1283.    }
  1284.    function stopHandleDrag(controlIndex)
  1285.    {
  1286.       var _loc2_ = this.controls[controlIndex];
  1287.       var _loc3_ = _loc2_.handle_mc;
  1288.       if(_loc2_.stopHandleDrag == undefined || !_loc2_.stopHandleDrag())
  1289.       {
  1290.          _loc3_.stopDrag();
  1291.       }
  1292.       _loc2_.isDragging = false;
  1293.    }
  1294.    function positionHandle(controlIndex)
  1295.    {
  1296.       var _loc2_ = this.controls[controlIndex];
  1297.       var _loc3_ = _loc2_.handle_mc;
  1298.       if(_loc3_ == undefined)
  1299.       {
  1300.          return undefined;
  1301.       }
  1302.       if(_loc2_.positionHandle != undefined && _loc2_.positionHandle())
  1303.       {
  1304.          return undefined;
  1305.       }
  1306.       var _loc4_ = _loc2_.origWidth != undefined ? _loc2_.origWidth : _loc2_._width;
  1307.       var _loc5_ = _loc4_ - _loc2_.handleRightMargin - _loc2_.handleLeftMargin;
  1308.       _loc3_._x = _loc2_._x + _loc2_.handleLeftMargin + _loc5_ * _loc2_.percentage / 100;
  1309.       _loc3_._y = _loc2_._y + _loc2_.handleY;
  1310.       if(_loc2_.fullness_mc != undefined)
  1311.       {
  1312.          this.positionBar(_loc2_,"fullness",_loc2_.percentage);
  1313.       }
  1314.    }
  1315.    function positionBar(ctrl, type, percent)
  1316.    {
  1317.       if(ctrl.positionBar != undefined && ctrl.positionBar(type,percent))
  1318.       {
  1319.          return undefined;
  1320.       }
  1321.       var _loc2_ = ctrl[type + "_mc"];
  1322.       if(_loc2_._parent == ctrl)
  1323.       {
  1324.          if(_loc2_.fill_mc == undefined)
  1325.          {
  1326.             _loc2_._xscale = ctrl[type + "XScale"] * percent / 100;
  1327.          }
  1328.          else
  1329.          {
  1330.             this.positionMaskedFill(_loc2_,_loc2_.fill_mc,percent);
  1331.          }
  1332.       }
  1333.       else
  1334.       {
  1335.          _loc2_._x = ctrl._x + ctrl[type + "LeftMargin"];
  1336.          _loc2_._y = ctrl._y + ctrl[type + "Y"];
  1337.          if(_loc2_.fill_mc == undefined)
  1338.          {
  1339.             _loc2_._width = (ctrl._width - ctrl[type + "LeftMargin"] - ctrl[type + "RightMargin"]) * percent / 100;
  1340.          }
  1341.          else
  1342.          {
  1343.             this.positionMaskedFill(_loc2_,_loc2_.fill_mc,percent);
  1344.          }
  1345.       }
  1346.    }
  1347.    function calcPercentageFromHandle(controlIndex)
  1348.    {
  1349.       var _loc2_ = this.controls[controlIndex];
  1350.       var _loc5_ = _loc2_.handle_mc;
  1351.       if(_loc2_.calcPercentageFromHandle == undefined || !_loc2_.calcPercentageFromHandle())
  1352.       {
  1353.          var _loc3_ = _loc2_.origWidth != undefined ? _loc2_.origWidth : _loc2_._width;
  1354.          var _loc6_ = _loc3_ - _loc2_.handleRightMargin - _loc2_.handleLeftMargin;
  1355.          var _loc4_ = _loc5_._x - (_loc2_._x + _loc2_.handleLeftMargin);
  1356.          _loc2_.percentage = _loc4_ / _loc6_ * 100;
  1357.          if(_loc2_.fullness_mc != undefined)
  1358.          {
  1359.             this.positionBar(_loc2_,"fullness",_loc2_.percentage);
  1360.          }
  1361.       }
  1362.       if(_loc2_.percentage < 0)
  1363.       {
  1364.          _loc2_.percentage = 0;
  1365.       }
  1366.       if(_loc2_.percentage > 100)
  1367.       {
  1368.          _loc2_.percentage = 100;
  1369.       }
  1370.    }
  1371.    function handleRelease(controlIndex)
  1372.    {
  1373.       var _loc3_ = this._vc.activeVideoPlayerIndex;
  1374.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1375.       if(controlIndex == mx.video.UIManager.SEEK_BAR)
  1376.       {
  1377.          this.seekBarListener(true);
  1378.       }
  1379.       else if(controlIndex == mx.video.UIManager.VOLUME_BAR)
  1380.       {
  1381.          this.volumeBarListener(true);
  1382.       }
  1383.       this.stopHandleDrag(controlIndex);
  1384.       this._vc.activeVideoPlayerIndex = _loc3_;
  1385.       if(controlIndex == mx.video.UIManager.SEEK_BAR)
  1386.       {
  1387.          this._vc._scrubFinish();
  1388.       }
  1389.    }
  1390.    function seekBarListener(finish)
  1391.    {
  1392.       var _loc3_ = this._vc.activeVideoPlayerIndex;
  1393.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1394.       var _loc4_ = this.controls[mx.video.UIManager.SEEK_BAR];
  1395.       this.calcPercentageFromHandle(mx.video.UIManager.SEEK_BAR);
  1396.       var _loc2_ = _loc4_.percentage;
  1397.       if(finish)
  1398.       {
  1399.          clearInterval(this._seekBarIntervalID);
  1400.          this._seekBarIntervalID = 0;
  1401.          if(_loc2_ != this._lastScrubPos)
  1402.          {
  1403.             this._vc.seekPercent(_loc2_);
  1404.          }
  1405.          this._vc.addEventListener("playheadUpdate",this);
  1406.          if(this._playAfterScrub)
  1407.          {
  1408.             this._vc.play();
  1409.          }
  1410.       }
  1411.       else if(this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex).state != mx.video.VideoPlayer.SEEKING)
  1412.       {
  1413.          if(this._seekBarScrubTolerance <= 0 || Math.abs(_loc2_ - this._lastScrubPos) > this._seekBarScrubTolerance || _loc2_ < this._seekBarScrubTolerance || _loc2_ > 100 - this._seekBarScrubTolerance)
  1414.          {
  1415.             if(_loc2_ != this._lastScrubPos)
  1416.             {
  1417.                this._lastScrubPos = _loc2_;
  1418.                this._vc.seekPercent(_loc2_);
  1419.             }
  1420.          }
  1421.       }
  1422.       this._vc.activeVideoPlayerIndex = _loc3_;
  1423.    }
  1424.    function volumeBarListener(finish)
  1425.    {
  1426.       var _loc3_ = this.controls[mx.video.UIManager.VOLUME_BAR];
  1427.       this.calcPercentageFromHandle(mx.video.UIManager.VOLUME_BAR);
  1428.       var _loc2_ = _loc3_.percentage;
  1429.       if(finish)
  1430.       {
  1431.          clearInterval(this._volumeBarIntervalID);
  1432.          this._volumeBarIntervalID = 0;
  1433.          this._vc.addEventListener("volumeUpdate",this);
  1434.       }
  1435.       if(finish || this._volumeBarScrubTolerance <= 0 || Math.abs(_loc2_ - this._lastVolumePos) > this._volumeBarScrubTolerance || _loc2_ < this._volumeBarScrubTolerance || _loc2_ > 100 - this._volumeBarScrubTolerance)
  1436.       {
  1437.          if(_loc2_ != this._lastVolumePos)
  1438.          {
  1439.             if(this._isMuted)
  1440.             {
  1441.                this.cachedSoundLevel = _loc2_;
  1442.             }
  1443.             else
  1444.             {
  1445.                this._vc.volume = _loc2_;
  1446.             }
  1447.          }
  1448.       }
  1449.    }
  1450.    function doBufferingDelay()
  1451.    {
  1452.       clearInterval(this._bufferingDelayIntervalID);
  1453.       this._bufferingDelayIntervalID = 0;
  1454.       var _loc2_ = this._vc.activeVideoPlayerIndex;
  1455.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1456.       if(this._vc.state == mx.video.FLVPlayback.BUFFERING)
  1457.       {
  1458.          this._bufferingOn = true;
  1459.          this.handleEvent({type:"stateChange",state:mx.video.FLVPlayback.BUFFERING,vp:this._vc.visibleVideoPlayerIndex});
  1460.       }
  1461.       this._vc.activeVideoPlayerIndex = _loc2_;
  1462.    }
  1463.    function dispatchMessage(ctrl)
  1464.    {
  1465.       if(ctrl.id == mx.video.UIManager.SEEK_BAR_HANDLE)
  1466.       {
  1467.          this._vc._scrubStart();
  1468.       }
  1469.       var _loc2_ = this._vc.activeVideoPlayerIndex;
  1470.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1471.       switch(ctrl.id)
  1472.       {
  1473.          case mx.video.UIManager.PAUSE_BUTTON:
  1474.             this._vc.pause();
  1475.             break;
  1476.          case mx.video.UIManager.PLAY_BUTTON:
  1477.             this._vc.play();
  1478.             break;
  1479.          case mx.video.UIManager.STOP_BUTTON:
  1480.             this._vc.stop();
  1481.             break;
  1482.          case mx.video.UIManager.SEEK_BAR_HANDLE:
  1483.             this.calcPercentageFromHandle(mx.video.UIManager.SEEK_BAR);
  1484.             this._lastScrubPos = this.controls[mx.video.UIManager.SEEK_BAR].percentage;
  1485.             this._vc.removeEventListener("playheadUpdate",this);
  1486.             if(this._vc.playing || this._vc.buffering)
  1487.             {
  1488.                this._playAfterScrub = true;
  1489.             }
  1490.             else if(this._vc.state != mx.video.VideoPlayer.SEEKING)
  1491.             {
  1492.                this._playAfterScrub = false;
  1493.             }
  1494.             this._seekBarIntervalID = setInterval(this,"seekBarListener",this._seekBarInterval,false);
  1495.             this.startHandleDrag(mx.video.UIManager.SEEK_BAR,mx.video.UIManager.SEEK_BAR_HANDLE);
  1496.             this._vc.pause();
  1497.             break;
  1498.          case mx.video.UIManager.VOLUME_BAR_HANDLE:
  1499.             this.calcPercentageFromHandle(mx.video.UIManager.VOLUME_BAR);
  1500.             this._lastVolumePos = this.controls[mx.video.UIManager.VOLUME_BAR].percentage;
  1501.             this._vc.removeEventListener("volumeUpdate",this);
  1502.             this._volumeBarIntervalID = setInterval(this,"volumeBarListener",this._volumeBarInterval,false);
  1503.             this.startHandleDrag(mx.video.UIManager.VOLUME_BAR,mx.video.UIManager.VOLUME_BAR_HANDLE);
  1504.             break;
  1505.          case mx.video.UIManager.BACK_BUTTON:
  1506.             this._vc.seekToPrevNavCuePoint();
  1507.             break;
  1508.          case mx.video.UIManager.FORWARD_BUTTON:
  1509.             this._vc.seekToNextNavCuePoint();
  1510.             break;
  1511.          case mx.video.UIManager.MUTE_ON_BUTTON:
  1512.          case mx.video.UIManager.MUTE_OFF_BUTTON:
  1513.             if(!this._isMuted)
  1514.             {
  1515.                this._isMuted = true;
  1516.                this.cachedSoundLevel = this._vc.volume;
  1517.                this._vc.volume = 0;
  1518.             }
  1519.             else
  1520.             {
  1521.                this._isMuted = false;
  1522.                this._vc.volume = this.cachedSoundLevel;
  1523.             }
  1524.             this.setEnabledAndVisibleForState(mx.video.UIManager.MUTE_OFF_BUTTON,mx.video.FLVPlayback.PLAYING);
  1525.             this.skinButtonControl(this.controls[mx.video.UIManager.MUTE_OFF_BUTTON]);
  1526.             this.setEnabledAndVisibleForState(mx.video.UIManager.MUTE_ON_BUTTON,mx.video.FLVPlayback.PLAYING);
  1527.             this.skinButtonControl(this.controls[mx.video.UIManager.MUTE_ON_BUTTON]);
  1528.             break;
  1529.          default:
  1530.             throw new Error("Unknown ButtonControl");
  1531.       }
  1532.       this._vc.activeVideoPlayerIndex = _loc2_;
  1533.    }
  1534.    function setEnabledAndVisibleForState(index, state)
  1535.    {
  1536.       var _loc5_ = this._vc.activeVideoPlayerIndex;
  1537.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1538.       var _loc3_ = state;
  1539.       if(_loc3_ == mx.video.FLVPlayback.BUFFERING && !this._bufferingOn)
  1540.       {
  1541.          _loc3_ = mx.video.FLVPlayback.PLAYING;
  1542.       }
  1543.       switch(index)
  1544.       {
  1545.          case mx.video.UIManager.VOLUME_BAR:
  1546.          case mx.video.UIManager.VOLUME_BAR_HANDLE:
  1547.             this.controls[index].myEnabled = true;
  1548.             this.controls[index].enabled = this._controlsEnabled;
  1549.             break;
  1550.          case mx.video.UIManager.MUTE_ON_BUTTON:
  1551.             this.controls[index].myEnabled = !this._isMuted;
  1552.             if(this.controls[mx.video.UIManager.MUTE_BUTTON] != undefined)
  1553.             {
  1554.                this.controls[index]._visible = this.controls[index].myEnabled;
  1555.             }
  1556.             break;
  1557.          case mx.video.UIManager.MUTE_OFF_BUTTON:
  1558.             this.controls[index].myEnabled = this._isMuted;
  1559.             if(this.controls[mx.video.UIManager.MUTE_BUTTON] != undefined)
  1560.             {
  1561.                this.controls[index]._visible = this.controls[index].myEnabled;
  1562.             }
  1563.             break;
  1564.          default:
  1565.             switch(_loc3_)
  1566.             {
  1567.                case mx.video.FLVPlayback.LOADING:
  1568.                case mx.video.FLVPlayback.CONNECTION_ERROR:
  1569.                   this.controls[index].myEnabled = false;
  1570.                   break;
  1571.                case mx.video.FLVPlayback.DISCONNECTED:
  1572.                   this.controls[index].myEnabled = this._vc.contentPath != undefined;
  1573.                   break;
  1574.                case mx.video.FLVPlayback.SEEKING:
  1575.                   break;
  1576.                default:
  1577.                   this.controls[index].myEnabled = true;
  1578.             }
  1579.       }
  1580.       switch(index)
  1581.       {
  1582.          case mx.video.UIManager.SEEK_BAR:
  1583.             switch(_loc3_)
  1584.             {
  1585.                case mx.video.FLVPlayback.STOPPED:
  1586.                case mx.video.FLVPlayback.PLAYING:
  1587.                case mx.video.FLVPlayback.PAUSED:
  1588.                case mx.video.FLVPlayback.REWINDING:
  1589.                case mx.video.FLVPlayback.SEEKING:
  1590.                   this.controls[index].myEnabled = true;
  1591.                   break;
  1592.                case mx.video.FLVPlayback.BUFFERING:
  1593.                   this.controls[index].myEnabled = !this._bufferingBarHides || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined;
  1594.                   break;
  1595.                default:
  1596.                   this.controls[index].myEnabled = false;
  1597.             }
  1598.             if(this.controls[index].myEnabled)
  1599.             {
  1600.                this.controls[index].myEnabled = !isNaN(this._vc.totalTime) && this._vc.totalTime > 0;
  1601.             }
  1602.             this.controls[index].handle_mc.myEnabled = this.controls[index].myEnabled;
  1603.             this.controls[index].handle_mc.enabled = this.controls[index].handle_mc.myEnabled;
  1604.             this.controls[index].handle_mc._visible = this.controls[index].myEnabled;
  1605.             var _loc4_ = !this._bufferingBarHides || this.controls[index].myEnabled || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined || !this.controls[mx.video.UIManager.BUFFERING_BAR]._visible;
  1606.             this.controls[index]._visible = _loc4_;
  1607.             this.controls[index].progress_mc._visible = _loc4_;
  1608.             this.controls[index].progress_mc.fill_mc._visible = _loc4_;
  1609.             this.controls[index].fullness_mc._visible = _loc4_;
  1610.             this.controls[index].progress_mc.fill_mc._visible = _loc4_;
  1611.             break;
  1612.          case mx.video.UIManager.BUFFERING_BAR:
  1613.             switch(_loc3_)
  1614.             {
  1615.                case mx.video.FLVPlayback.STOPPED:
  1616.                case mx.video.FLVPlayback.PLAYING:
  1617.                case mx.video.FLVPlayback.PAUSED:
  1618.                case mx.video.FLVPlayback.REWINDING:
  1619.                case mx.video.FLVPlayback.SEEKING:
  1620.                   this.controls[index].myEnabled = false;
  1621.                   break;
  1622.                default:
  1623.                   this.controls[index].myEnabled = true;
  1624.             }
  1625.             this.controls[index]._visible = this.controls[index].myEnabled;
  1626.             this.controls[index].fill_mc._visible = this.controls[index].myEnabled;
  1627.             break;
  1628.          case mx.video.UIManager.PAUSE_BUTTON:
  1629.             switch(_loc3_)
  1630.             {
  1631.                case mx.video.FLVPlayback.DISCONNECTED:
  1632.                case mx.video.FLVPlayback.STOPPED:
  1633.                case mx.video.FLVPlayback.PAUSED:
  1634.                case mx.video.FLVPlayback.REWINDING:
  1635.                   this.controls[index].myEnabled = false;
  1636.                   break;
  1637.                case mx.video.FLVPlayback.PLAYING:
  1638.                   this.controls[index].myEnabled = true;
  1639.                   break;
  1640.                case mx.video.FLVPlayback.BUFFERING:
  1641.                   this.controls[index].myEnabled = !this._bufferingBarHides || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined;
  1642.             }
  1643.             if(this.controls[mx.video.UIManager.PLAY_PAUSE_BUTTON] != undefined)
  1644.             {
  1645.                this.controls[index]._visible = this.controls[index].myEnabled;
  1646.             }
  1647.             break;
  1648.          case mx.video.UIManager.PLAY_BUTTON:
  1649.             switch(_loc3_)
  1650.             {
  1651.                case mx.video.FLVPlayback.PLAYING:
  1652.                   this.controls[index].myEnabled = false;
  1653.                   break;
  1654.                case mx.video.FLVPlayback.STOPPED:
  1655.                case mx.video.FLVPlayback.PAUSED:
  1656.                   this.controls[index].myEnabled = true;
  1657.                   break;
  1658.                case mx.video.FLVPlayback.BUFFERING:
  1659.                   this.controls[index].myEnabled = !this._bufferingBarHides || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined;
  1660.             }
  1661.             if(this.controls[mx.video.UIManager.PLAY_PAUSE_BUTTON] != undefined)
  1662.             {
  1663.                this.controls[index]._visible = !this.controls[mx.video.UIManager.PAUSE_BUTTON]._visible;
  1664.             }
  1665.             break;
  1666.          case mx.video.UIManager.STOP_BUTTON:
  1667.             switch(_loc3_)
  1668.             {
  1669.                case mx.video.FLVPlayback.DISCONNECTED:
  1670.                case mx.video.FLVPlayback.STOPPED:
  1671.                   this.controls[index].myEnabled = false;
  1672.                   break;
  1673.                case mx.video.FLVPlayback.PAUSED:
  1674.                case mx.video.FLVPlayback.PLAYING:
  1675.                case mx.video.FLVPlayback.BUFFERING:
  1676.                   this.controls[index].myEnabled = true;
  1677.             }
  1678.             break;
  1679.          case mx.video.UIManager.BACK_BUTTON:
  1680.          case mx.video.UIManager.FORWARD_BUTTON:
  1681.             if(_loc3_ !== mx.video.FLVPlayback.BUFFERING)
  1682.             {
  1683.                break;
  1684.             }
  1685.             this.controls[index].myEnabled = !this._bufferingBarHides || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined;
  1686.             break;
  1687.       }
  1688.       this.controls[index].enabled = this._controlsEnabled && this.controls[index].myEnabled;
  1689.       this._vc.activeVideoPlayerIndex = _loc5_;
  1690.    }
  1691.    function setupSkinAutoHide()
  1692.    {
  1693.       var _loc2_ = this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex);
  1694.       if(this._skinAutoHide && this.skin_mc != undefined)
  1695.       {
  1696.          this.skinAutoHideHitTest();
  1697.          if(this._skinAutoHideIntervalID == 0)
  1698.          {
  1699.             this._skinAutoHideIntervalID = setInterval(this,"skinAutoHideHitTest",mx.video.UIManager.SKIN_AUTO_HIDE_INTERVAL);
  1700.          }
  1701.       }
  1702.       else
  1703.       {
  1704.          this.skin_mc._visible = this.__visible;
  1705.          clearInterval(this._skinAutoHideIntervalID);
  1706.          this._skinAutoHideIntervalID = 0;
  1707.       }
  1708.    }
  1709.    function skinAutoHideHitTest()
  1710.    {
  1711.       if(!this.__visible)
  1712.       {
  1713.          this.skin_mc._visible = false;
  1714.       }
  1715.       else
  1716.       {
  1717.          var _loc4_ = this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex);
  1718.          var _loc3_ = _loc4_.hitTest(_root._xmouse,_root._ymouse,true);
  1719.          if(!_loc3_ && this.border_mc != undefined)
  1720.          {
  1721.             _loc3_ = this.border_mc.hitTest(_root._xmouse,_root._ymouse,true);
  1722.          }
  1723.          this.skin_mc._visible = _loc3_;
  1724.       }
  1725.    }
  1726. }
  1727.