home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / Free Download Manager / fdminst.exe / {app} / player.swf / scripts / __Packages / mx / video / UIManager.as < prev    next >
Encoding:
Text File  |  2012-08-12  |  58.2 KB  |  1,728 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.          _loc4_;
  828.          var _loc2_ = this.layout_mc[prefix + _loc4_++ + "_mc"];
  829.          if(_loc2_ == undefined)
  830.          {
  831.             break;
  832.          }
  833.          var _loc3_ = _loc2_.mc;
  834.          if(_loc3_ == undefined)
  835.          {
  836.             _loc3_ = _loc2_._parent._parent[_loc2_._name];
  837.          }
  838.          if(_loc3_ == undefined)
  839.          {
  840.             throw new Error("Bad clip in skin: " + _loc2_);
  841.          }
  842.          _loc3_.skin = _loc2_;
  843.          this.customClips.push(_loc3_);
  844.          if(prefix == "bg" && _loc4_ == 2)
  845.          {
  846.             this.border_mc = _loc3_;
  847.          }
  848.       }
  849.    }
  850.    function setSkin(index, s)
  851.    {
  852.       if(s == undefined)
  853.       {
  854.          return undefined;
  855.       }
  856.       var _loc2_ = s.mc;
  857.       if(_loc2_ == undefined)
  858.       {
  859.          _loc2_ = s._parent._parent[s._name];
  860.       }
  861.       if(_loc2_ == undefined)
  862.       {
  863.          throw new Error("Bad clip in skin: " + s);
  864.       }
  865.       _loc2_.skin = s;
  866.       if(index < mx.video.UIManager.NUM_BUTTONS)
  867.       {
  868.          this.setupSkinStates(_loc2_);
  869.       }
  870.       else
  871.       {
  872.          switch(index)
  873.          {
  874.             case mx.video.UIManager.PLAY_PAUSE_BUTTON:
  875.                this.setupSkinStates(_loc2_.play_mc);
  876.                this.setupSkinStates(_loc2_.pause_mc);
  877.                break;
  878.             case mx.video.UIManager.MUTE_BUTTON:
  879.                this.setupSkinStates(_loc2_.on_mc);
  880.                this.setupSkinStates(_loc2_.off_mc);
  881.                break;
  882.             case mx.video.UIManager.SEEK_BAR:
  883.             case mx.video.UIManager.VOLUME_BAR:
  884.                var _loc4_ = index != mx.video.UIManager.SEEK_BAR ? "volumeBar" : "seekBar";
  885.                if(_loc2_.handle_mc == undefined)
  886.                {
  887.                   _loc2_.handle_mc = _loc2_.skin.seekBarHandle_mc;
  888.                   if(_loc2_.handle_mc == undefined)
  889.                   {
  890.                      _loc2_.handle_mc = _loc2_.skin._parent._parent[_loc4_ + "Handle_mc"];
  891.                   }
  892.                }
  893.                if(_loc2_.progress_mc == undefined)
  894.                {
  895.                   _loc2_.progress_mc = _loc2_.skin.progress_mc;
  896.                   if(_loc2_.progress_mc == undefined)
  897.                   {
  898.                      _loc2_.progress_mc = _loc2_.skin._parent._parent[_loc4_ + "Progress_mc"];
  899.                   }
  900.                }
  901.                if(_loc2_.fullness_mc == undefined)
  902.                {
  903.                   _loc2_.fullness_mc = _loc2_.skin.fullness_mc;
  904.                   if(_loc2_.fullness_mc == undefined)
  905.                   {
  906.                      _loc2_.fullness_mc = _loc2_.skin._parent._parent[_loc4_ + "Fullness_mc"];
  907.                   }
  908.                }
  909.                break;
  910.             case mx.video.UIManager.BUFFERING_BAR:
  911.                if(_loc2_.fill_mc == undefined)
  912.                {
  913.                   _loc2_.fill_mc = _loc2_.skin.fill_mc;
  914.                   if(_loc2_.fill_mc == undefined)
  915.                   {
  916.                      _loc2_.fill_mc = _loc2_.skin._parent._parent.bufferingBarFill_mc;
  917.                   }
  918.                }
  919.          }
  920.       }
  921.       this.setControl(index,_loc2_);
  922.    }
  923.    function setupSkinStates(ctrl)
  924.    {
  925.       if(ctrl.up_mc == undefined)
  926.       {
  927.          ctrl.up_mc = ctrl;
  928.          ctrl.over_mc = ctrl;
  929.          ctrl.down_mc = ctrl;
  930.          ctrl.disabled_mc = ctrl;
  931.       }
  932.       else
  933.       {
  934.          ctrl._x = 0;
  935.          ctrl._y = 0;
  936.          ctrl.up_mc._x = 0;
  937.          ctrl.up_mc._y = 0;
  938.          ctrl.up_mc._visible = true;
  939.          if(ctrl.over_mc == undefined)
  940.          {
  941.             ctrl.over_mc = ctrl.up_mc;
  942.          }
  943.          else
  944.          {
  945.             ctrl.over_mc._x = 0;
  946.             ctrl.over_mc._y = 0;
  947.             ctrl.over_mc._visible = false;
  948.          }
  949.          if(ctrl.down_mc == undefined)
  950.          {
  951.             ctrl.down_mc = ctrl.up_mc;
  952.          }
  953.          else
  954.          {
  955.             ctrl.down_mc._x = 0;
  956.             ctrl.down_mc._y = 0;
  957.             ctrl.down_mc._visible = false;
  958.          }
  959.          if(ctrl.disabled_mc == undefined)
  960.          {
  961.             ctrl.disabled_mc_mc = ctrl.up_mc;
  962.          }
  963.          else
  964.          {
  965.             ctrl.disabled_mc._x = 0;
  966.             ctrl.disabled_mc._y = 0;
  967.             ctrl.disabled_mc._visible = false;
  968.          }
  969.       }
  970.    }
  971.    function skinButtonControl(ctrl)
  972.    {
  973.       if(ctrl.onEnterFrame != undefined)
  974.       {
  975.          delete ctrl.onEnterFrame;
  976.          ctrl.onEnterFrame = undefined;
  977.       }
  978.       if(ctrl.enabled)
  979.       {
  980.          switch(ctrl.state)
  981.          {
  982.             case mx.video.UIManager.UP_STATE:
  983.                if(ctrl.up_mc == undefined)
  984.                {
  985.                   ctrl.up_mc = ctrl.attachMovie(ctrl.upLinkageID,"up_mc",ctrl.getNextHighestDepth());
  986.                }
  987.                this.applySkinState(ctrl,ctrl.up_mc);
  988.                break;
  989.             case mx.video.UIManager.OVER_STATE:
  990.                if(ctrl.over_mc == undefined)
  991.                {
  992.                   if(ctrl.overLinkageID == undefined)
  993.                   {
  994.                      ctrl.over_mc = ctrl.up_mc;
  995.                   }
  996.                   else
  997.                   {
  998.                      ctrl.over_mc = ctrl.attachMovie(ctrl.overLinkageID,"over_mc",ctrl.getNextHighestDepth());
  999.                   }
  1000.                }
  1001.                this.applySkinState(ctrl,ctrl.over_mc);
  1002.                break;
  1003.             case mx.video.UIManager.DOWN_STATE:
  1004.                if(ctrl.down_mc == undefined)
  1005.                {
  1006.                   if(ctrl.downLinkageID == undefined)
  1007.                   {
  1008.                      ctrl.down_mc = ctrl.up_mc;
  1009.                   }
  1010.                   else
  1011.                   {
  1012.                      ctrl.down_mc = ctrl.attachMovie(ctrl.downLinkageID,"down_mc",ctrl.getNextHighestDepth());
  1013.                   }
  1014.                }
  1015.                this.applySkinState(ctrl,ctrl.down_mc);
  1016.          }
  1017.       }
  1018.       else
  1019.       {
  1020.          ctrl.state = mx.video.UIManager.UP_STATE;
  1021.          if(ctrl.disabled_mc == undefined)
  1022.          {
  1023.             if(ctrl.disabledLinkageID == undefined)
  1024.             {
  1025.                ctrl.disabled_mc = ctrl.up_mc;
  1026.             }
  1027.             else
  1028.             {
  1029.                ctrl.disabled_mc = ctrl.attachMovie(ctrl.disabledLinkageID,"disabled_mc",ctrl.getNextHighestDepth());
  1030.             }
  1031.          }
  1032.          this.applySkinState(ctrl,ctrl.disabled_mc);
  1033.       }
  1034.       if(ctrl.placeholder_mc != undefined)
  1035.       {
  1036.          ctrl.placeholder_mc.unloadMovie();
  1037.          delete ctrl.placeholder_mc;
  1038.          ctrl.placeholder_mc = undefined;
  1039.       }
  1040.    }
  1041.    function applySkinState(ctrl, state)
  1042.    {
  1043.       if(state != ctrl.currentState_mc)
  1044.       {
  1045.          if(state != undefined)
  1046.          {
  1047.             state._visible = true;
  1048.          }
  1049.          if(ctrl.currentState_mc != undefined)
  1050.          {
  1051.             ctrl.currentState_mc._visible = false;
  1052.          }
  1053.          ctrl.currentState_mc = state;
  1054.       }
  1055.    }
  1056.    function addBarControl(controlIndex)
  1057.    {
  1058.       var _loc2_ = this.controls[controlIndex];
  1059.       _loc2_.isDragging = false;
  1060.       _loc2_.percentage = 0;
  1061.       _loc2_.uiMgr = this;
  1062.       _loc2_.controlIndex = controlIndex;
  1063.       if(_loc2_._parent == this.skin_mc)
  1064.       {
  1065.          this.finishAddBarControl(controlIndex);
  1066.       }
  1067.       else
  1068.       {
  1069.          _loc2_.onEnterFrame = function()
  1070.          {
  1071.             this.uiMgr.finishAddBarControl(this.controlIndex);
  1072.          };
  1073.       }
  1074.    }
  1075.    function finishAddBarControl(controlIndex)
  1076.    {
  1077.       var _loc2_ = this.controls[controlIndex];
  1078.       delete _loc2_.onEnterFrame;
  1079.       _loc2_.onEnterFrame = undefined;
  1080.       if(_loc2_.addBarControl != undefined)
  1081.       {
  1082.          _loc2_.addBarControl();
  1083.       }
  1084.       this.calcBarMargins(_loc2_,"handle",true);
  1085.       this.calcBarMargins(_loc2_,"progress",false);
  1086.       this.calcBarMargins(_loc2_.progress_mc,"fill",false);
  1087.       this.calcBarMargins(_loc2_.progress_mc,"mask",false);
  1088.       this.calcBarMargins(_loc2_,"fullness",false);
  1089.       this.calcBarMargins(_loc2_.fullness_mc,"fill",false);
  1090.       this.calcBarMargins(_loc2_.fullness_mc,"mask",false);
  1091.       _loc2_.origWidth = _loc2_._width;
  1092.       _loc2_.origHeight = _loc2_._height;
  1093.       this.fixUpBar(_loc2_,"progress");
  1094.       if(_loc2_.progress_mc != undefined)
  1095.       {
  1096.          this.fixUpBar(_loc2_,"progressBarFill");
  1097.          if(this._progressPercent == undefined)
  1098.          {
  1099.             this._progressPercent = !this._vc.isRTMP ? 0 : 100;
  1100.          }
  1101.          this.positionBar(_loc2_,"progress",this._progressPercent);
  1102.       }
  1103.       this.fixUpBar(_loc2_,"fullness");
  1104.       if(_loc2_.fullness_mc != undefined)
  1105.       {
  1106.          this.fixUpBar(_loc2_,"fullnessBarFill");
  1107.       }
  1108.       this.fixUpBar(_loc2_,"handle");
  1109.       _loc2_.handle_mc.controlIndex = controlIndex;
  1110.       switch(controlIndex)
  1111.       {
  1112.          case mx.video.UIManager.SEEK_BAR:
  1113.             this.setControl(mx.video.UIManager.SEEK_BAR_HANDLE,_loc2_.handle_mc);
  1114.             break;
  1115.          case mx.video.UIManager.VOLUME_BAR:
  1116.             this.setControl(mx.video.UIManager.VOLUME_BAR_HANDLE,_loc2_.handle_mc);
  1117.       }
  1118.       this.positionHandle(controlIndex);
  1119.    }
  1120.    function fixUpBar(ctrl, type)
  1121.    {
  1122.       if(ctrl[type + "LinkageID"] != undefined && ctrl[type + "LinkageID"].length > 0)
  1123.       {
  1124.          var _loc1_ = undefined;
  1125.          if(ctrl[type + "Below"])
  1126.          {
  1127.             _loc1_ = -1;
  1128.             while(ctrl._parent.getInstanceAtDepth(_loc1_) != undefined)
  1129.             {
  1130.                _loc1_ = _loc1_ - 1;
  1131.             }
  1132.          }
  1133.          else
  1134.          {
  1135.             ctrl[type + "Below"] = false;
  1136.             _loc1_ = ctrl._parent.getNextHighestDepth();
  1137.          }
  1138.          ctrl[type + "_mc"] = ctrl._parent.attachMovie(ctrl[type + "LinkageID"],type + "_mc",_loc1_);
  1139.       }
  1140.    }
  1141.    function calcBarMargins(ctrl, type, symmetricMargins)
  1142.    {
  1143.       var _loc2_ = ctrl[type + "_mc"];
  1144.       if(_loc2_ == undefined)
  1145.       {
  1146.          return undefined;
  1147.       }
  1148.       if(ctrl[type + "LeftMargin"] == undefined && _loc2_._parent == ctrl._parent)
  1149.       {
  1150.          ctrl[type + "LeftMargin"] = _loc2_._x - ctrl._x;
  1151.       }
  1152.       if(ctrl[type + "RightMargin"] == undefined)
  1153.       {
  1154.          if(symmetricMargins)
  1155.          {
  1156.             ctrl[type + "RightMargin"] = ctrl[type + "LeftMargin"];
  1157.          }
  1158.          else if(_loc2_._parent == ctrl._parent)
  1159.          {
  1160.             ctrl[type + "RightMargin"] = ctrl._width - _loc2_._width - _loc2_._x + ctrl._x;
  1161.          }
  1162.       }
  1163.       if(ctrl[type + "TopMargin"] == undefined && _loc2_._parent == ctrl._parent)
  1164.       {
  1165.          ctrl[type + "TopMargin"] = _loc2_._y - ctrl._y;
  1166.       }
  1167.       if(ctrl[type + "BottomMargin"] == undefined)
  1168.       {
  1169.          if(symmetricMargins)
  1170.          {
  1171.             ctrl[type + "BottomMargin"] = ctrl[type + "TopMargin"];
  1172.          }
  1173.          else if(_loc2_._parent == ctrl._parent)
  1174.          {
  1175.             ctrl[type + "BottomMargin"] = ctrl._height - _loc2_._height - _loc2_._y + ctrl._y;
  1176.          }
  1177.       }
  1178.       if(ctrl[type + "X"] == undefined)
  1179.       {
  1180.          if(_loc2_._parent == ctrl._parent)
  1181.          {
  1182.             ctrl[type + "X"] = _loc2_._x - ctrl._x;
  1183.          }
  1184.          else if(_loc2_._parent == ctrl)
  1185.          {
  1186.             ctrl[type + "X"] = _loc2_._x;
  1187.          }
  1188.       }
  1189.       if(ctrl[type + "Y"] == undefined)
  1190.       {
  1191.          if(_loc2_._parent == ctrl._parent)
  1192.          {
  1193.             ctrl[type + "Y"] = _loc2_._y - ctrl._y;
  1194.          }
  1195.          else if(_loc2_._parent == ctrl)
  1196.          {
  1197.             ctrl[type + "Y"] = _loc2_._y;
  1198.          }
  1199.       }
  1200.       ctrl[type + "XScale"] = _loc2_._xscale;
  1201.       ctrl[type + "YScale"] = _loc2_._yscale;
  1202.       ctrl[type + "Width"] = _loc2_._width;
  1203.       ctrl[type + "Height"] = _loc2_._height;
  1204.    }
  1205.    function finishAddBufferingBar()
  1206.    {
  1207.       var _loc2_ = this.controls[mx.video.UIManager.BUFFERING_BAR];
  1208.       delete _loc2_.onEnterFrame;
  1209.       _loc2_.onEnterFrame = undefined;
  1210.       this.calcBarMargins(_loc2_,"fill",true);
  1211.       this.fixUpBar(_loc2_,"fill");
  1212.       if(_loc2_.fill_mc != undefined)
  1213.       {
  1214.          this.positionMaskedFill(_loc2_,_loc2_.fill_mc,100);
  1215.       }
  1216.    }
  1217.    function positionMaskedFill(ctrl, fill, percent)
  1218.    {
  1219.       var _loc5_ = fill._parent;
  1220.       var _loc3_ = ctrl.mask_mc;
  1221.       if(_loc3_ == undefined)
  1222.       {
  1223.          _loc3_ = _loc5_.createEmptyMovieClip(ctrl._name + "Mask_mc",_loc5_.getNextHighestDepth());
  1224.          ctrl.mask_mc = _loc3_;
  1225.          _loc3_.beginFill(16777215);
  1226.          _loc3_.lineTo(0,0);
  1227.          _loc3_.lineTo(1,0);
  1228.          _loc3_.lineTo(1,1);
  1229.          _loc3_.lineTo(0,1);
  1230.          _loc3_.lineTo(0,0);
  1231.          _loc3_.endFill();
  1232.          fill.setMask(_loc3_);
  1233.          _loc3_._x = ctrl.fillX;
  1234.          _loc3_._y = ctrl.fillY;
  1235.          _loc3_._width = ctrl.fillWidth;
  1236.          _loc3_._height = ctrl.fillHeight;
  1237.          _loc3_._visible = false;
  1238.          this.calcBarMargins(ctrl,"mask",true);
  1239.       }
  1240.       if(_loc5_ == ctrl)
  1241.       {
  1242.          if(fill.slideReveal)
  1243.          {
  1244.             fill._x = ctrl.maskX - ctrl.fillWidth + ctrl.fillWidth * percent / 100;
  1245.          }
  1246.          else
  1247.          {
  1248.             _loc3_._width = ctrl.fillWidth * percent / 100;
  1249.          }
  1250.       }
  1251.       else if(_loc5_ == ctrl._parent)
  1252.       {
  1253.          if(fill.slideReveal)
  1254.          {
  1255.             _loc3_._x = ctrl._x + ctrl.maskLeftMargin;
  1256.             _loc3_._y = ctrl._y + ctrl.maskTopMargin;
  1257.             _loc3_._width = ctrl._width - ctrl.maskRightMargin - ctrl.maskLeftMargin;
  1258.             _loc3_._height = ctrl._height - ctrl.maskTopMargin - ctrl.maskBottomMargin;
  1259.             fill._x = _loc3_._x - ctrl.fillWidth + ctrl.maskWidth * percent / 100;
  1260.             fill._y = ctrl._y + ctrl.fillTopMargin;
  1261.          }
  1262.          else
  1263.          {
  1264.             fill._x = ctrl._x + ctrl.fillLeftMargin;
  1265.             fill._y = ctrl._y + ctrl.fillTopMargin;
  1266.             _loc3_._x = fill._x;
  1267.             _loc3_._y = fill._y;
  1268.             _loc3_._width = (ctrl._width - ctrl.fillRightMargin - ctrl.fillLeftMargin) * percent / 100;
  1269.             _loc3_._height = ctrl._height - ctrl.fillTopMargin - ctrl.fillBottomMargin;
  1270.          }
  1271.       }
  1272.    }
  1273.    function startHandleDrag(controlIndex)
  1274.    {
  1275.       var _loc2_ = this.controls[controlIndex];
  1276.       var _loc5_ = _loc2_.handle_mc;
  1277.       if(_loc2_.startHandleDrag == undefined || !_loc2_.startHandleDrag())
  1278.       {
  1279.          var _loc3_ = _loc2_._y + _loc2_.handleY;
  1280.          var _loc4_ = _loc2_.origWidth != undefined ? _loc2_.origWidth : _loc2_._width;
  1281.          _loc5_.startDrag(false,_loc2_._x + _loc2_.handleLeftMargin,_loc3_,_loc2_._x + _loc4_ - _loc2_.handleRightMargin,_loc3_);
  1282.       }
  1283.       _loc2_.isDragging = true;
  1284.    }
  1285.    function stopHandleDrag(controlIndex)
  1286.    {
  1287.       var _loc2_ = this.controls[controlIndex];
  1288.       var _loc3_ = _loc2_.handle_mc;
  1289.       if(_loc2_.stopHandleDrag == undefined || !_loc2_.stopHandleDrag())
  1290.       {
  1291.          _loc3_.stopDrag();
  1292.       }
  1293.       _loc2_.isDragging = false;
  1294.    }
  1295.    function positionHandle(controlIndex)
  1296.    {
  1297.       var _loc2_ = this.controls[controlIndex];
  1298.       var _loc3_ = _loc2_.handle_mc;
  1299.       if(_loc3_ == undefined)
  1300.       {
  1301.          return undefined;
  1302.       }
  1303.       if(_loc2_.positionHandle != undefined && _loc2_.positionHandle())
  1304.       {
  1305.          return undefined;
  1306.       }
  1307.       var _loc4_ = _loc2_.origWidth != undefined ? _loc2_.origWidth : _loc2_._width;
  1308.       var _loc5_ = _loc4_ - _loc2_.handleRightMargin - _loc2_.handleLeftMargin;
  1309.       _loc3_._x = _loc2_._x + _loc2_.handleLeftMargin + _loc5_ * _loc2_.percentage / 100;
  1310.       _loc3_._y = _loc2_._y + _loc2_.handleY;
  1311.       if(_loc2_.fullness_mc != undefined)
  1312.       {
  1313.          this.positionBar(_loc2_,"fullness",_loc2_.percentage);
  1314.       }
  1315.    }
  1316.    function positionBar(ctrl, type, percent)
  1317.    {
  1318.       if(ctrl.positionBar != undefined && ctrl.positionBar(type,percent))
  1319.       {
  1320.          return undefined;
  1321.       }
  1322.       var _loc2_ = ctrl[type + "_mc"];
  1323.       if(_loc2_._parent == ctrl)
  1324.       {
  1325.          if(_loc2_.fill_mc == undefined)
  1326.          {
  1327.             _loc2_._xscale = ctrl[type + "XScale"] * percent / 100;
  1328.          }
  1329.          else
  1330.          {
  1331.             this.positionMaskedFill(_loc2_,_loc2_.fill_mc,percent);
  1332.          }
  1333.       }
  1334.       else
  1335.       {
  1336.          _loc2_._x = ctrl._x + ctrl[type + "LeftMargin"];
  1337.          _loc2_._y = ctrl._y + ctrl[type + "Y"];
  1338.          if(_loc2_.fill_mc == undefined)
  1339.          {
  1340.             _loc2_._width = (ctrl._width - ctrl[type + "LeftMargin"] - ctrl[type + "RightMargin"]) * percent / 100;
  1341.          }
  1342.          else
  1343.          {
  1344.             this.positionMaskedFill(_loc2_,_loc2_.fill_mc,percent);
  1345.          }
  1346.       }
  1347.    }
  1348.    function calcPercentageFromHandle(controlIndex)
  1349.    {
  1350.       var _loc2_ = this.controls[controlIndex];
  1351.       var _loc5_ = _loc2_.handle_mc;
  1352.       if(_loc2_.calcPercentageFromHandle == undefined || !_loc2_.calcPercentageFromHandle())
  1353.       {
  1354.          var _loc3_ = _loc2_.origWidth != undefined ? _loc2_.origWidth : _loc2_._width;
  1355.          var _loc6_ = _loc3_ - _loc2_.handleRightMargin - _loc2_.handleLeftMargin;
  1356.          var _loc4_ = _loc5_._x - (_loc2_._x + _loc2_.handleLeftMargin);
  1357.          _loc2_.percentage = _loc4_ / _loc6_ * 100;
  1358.          if(_loc2_.fullness_mc != undefined)
  1359.          {
  1360.             this.positionBar(_loc2_,"fullness",_loc2_.percentage);
  1361.          }
  1362.       }
  1363.       if(_loc2_.percentage < 0)
  1364.       {
  1365.          _loc2_.percentage = 0;
  1366.       }
  1367.       if(_loc2_.percentage > 100)
  1368.       {
  1369.          _loc2_.percentage = 100;
  1370.       }
  1371.    }
  1372.    function handleRelease(controlIndex)
  1373.    {
  1374.       var _loc3_ = this._vc.activeVideoPlayerIndex;
  1375.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1376.       if(controlIndex == mx.video.UIManager.SEEK_BAR)
  1377.       {
  1378.          this.seekBarListener(true);
  1379.       }
  1380.       else if(controlIndex == mx.video.UIManager.VOLUME_BAR)
  1381.       {
  1382.          this.volumeBarListener(true);
  1383.       }
  1384.       this.stopHandleDrag(controlIndex);
  1385.       this._vc.activeVideoPlayerIndex = _loc3_;
  1386.       if(controlIndex == mx.video.UIManager.SEEK_BAR)
  1387.       {
  1388.          this._vc._scrubFinish();
  1389.       }
  1390.    }
  1391.    function seekBarListener(finish)
  1392.    {
  1393.       var _loc3_ = this._vc.activeVideoPlayerIndex;
  1394.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1395.       var _loc4_ = this.controls[mx.video.UIManager.SEEK_BAR];
  1396.       this.calcPercentageFromHandle(mx.video.UIManager.SEEK_BAR);
  1397.       var _loc2_ = _loc4_.percentage;
  1398.       if(finish)
  1399.       {
  1400.          clearInterval(this._seekBarIntervalID);
  1401.          this._seekBarIntervalID = 0;
  1402.          if(_loc2_ != this._lastScrubPos)
  1403.          {
  1404.             this._vc.seekPercent(_loc2_);
  1405.          }
  1406.          this._vc.addEventListener("playheadUpdate",this);
  1407.          if(this._playAfterScrub)
  1408.          {
  1409.             this._vc.play();
  1410.          }
  1411.       }
  1412.       else if(this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex).state != mx.video.VideoPlayer.SEEKING)
  1413.       {
  1414.          if(this._seekBarScrubTolerance <= 0 || Math.abs(_loc2_ - this._lastScrubPos) > this._seekBarScrubTolerance || _loc2_ < this._seekBarScrubTolerance || _loc2_ > 100 - this._seekBarScrubTolerance)
  1415.          {
  1416.             if(_loc2_ != this._lastScrubPos)
  1417.             {
  1418.                this._lastScrubPos = _loc2_;
  1419.                this._vc.seekPercent(_loc2_);
  1420.             }
  1421.          }
  1422.       }
  1423.       this._vc.activeVideoPlayerIndex = _loc3_;
  1424.    }
  1425.    function volumeBarListener(finish)
  1426.    {
  1427.       var _loc3_ = this.controls[mx.video.UIManager.VOLUME_BAR];
  1428.       this.calcPercentageFromHandle(mx.video.UIManager.VOLUME_BAR);
  1429.       var _loc2_ = _loc3_.percentage;
  1430.       if(finish)
  1431.       {
  1432.          clearInterval(this._volumeBarIntervalID);
  1433.          this._volumeBarIntervalID = 0;
  1434.          this._vc.addEventListener("volumeUpdate",this);
  1435.       }
  1436.       if(finish || this._volumeBarScrubTolerance <= 0 || Math.abs(_loc2_ - this._lastVolumePos) > this._volumeBarScrubTolerance || _loc2_ < this._volumeBarScrubTolerance || _loc2_ > 100 - this._volumeBarScrubTolerance)
  1437.       {
  1438.          if(_loc2_ != this._lastVolumePos)
  1439.          {
  1440.             if(this._isMuted)
  1441.             {
  1442.                this.cachedSoundLevel = _loc2_;
  1443.             }
  1444.             else
  1445.             {
  1446.                this._vc.volume = _loc2_;
  1447.             }
  1448.          }
  1449.       }
  1450.    }
  1451.    function doBufferingDelay()
  1452.    {
  1453.       clearInterval(this._bufferingDelayIntervalID);
  1454.       this._bufferingDelayIntervalID = 0;
  1455.       var _loc2_ = this._vc.activeVideoPlayerIndex;
  1456.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1457.       if(this._vc.state == mx.video.FLVPlayback.BUFFERING)
  1458.       {
  1459.          this._bufferingOn = true;
  1460.          this.handleEvent({type:"stateChange",state:mx.video.FLVPlayback.BUFFERING,vp:this._vc.visibleVideoPlayerIndex});
  1461.       }
  1462.       this._vc.activeVideoPlayerIndex = _loc2_;
  1463.    }
  1464.    function dispatchMessage(ctrl)
  1465.    {
  1466.       if(ctrl.id == mx.video.UIManager.SEEK_BAR_HANDLE)
  1467.       {
  1468.          this._vc._scrubStart();
  1469.       }
  1470.       var _loc2_ = this._vc.activeVideoPlayerIndex;
  1471.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1472.       switch(ctrl.id)
  1473.       {
  1474.          case mx.video.UIManager.PAUSE_BUTTON:
  1475.             this._vc.pause();
  1476.             break;
  1477.          case mx.video.UIManager.PLAY_BUTTON:
  1478.             this._vc.play();
  1479.             break;
  1480.          case mx.video.UIManager.STOP_BUTTON:
  1481.             this._vc.stop();
  1482.             break;
  1483.          case mx.video.UIManager.SEEK_BAR_HANDLE:
  1484.             this.calcPercentageFromHandle(mx.video.UIManager.SEEK_BAR);
  1485.             this._lastScrubPos = this.controls[mx.video.UIManager.SEEK_BAR].percentage;
  1486.             this._vc.removeEventListener("playheadUpdate",this);
  1487.             if(this._vc.playing || this._vc.buffering)
  1488.             {
  1489.                this._playAfterScrub = true;
  1490.             }
  1491.             else if(this._vc.state != mx.video.VideoPlayer.SEEKING)
  1492.             {
  1493.                this._playAfterScrub = false;
  1494.             }
  1495.             this._seekBarIntervalID = setInterval(this,"seekBarListener",this._seekBarInterval,false);
  1496.             this.startHandleDrag(mx.video.UIManager.SEEK_BAR,mx.video.UIManager.SEEK_BAR_HANDLE);
  1497.             this._vc.pause();
  1498.             break;
  1499.          case mx.video.UIManager.VOLUME_BAR_HANDLE:
  1500.             this.calcPercentageFromHandle(mx.video.UIManager.VOLUME_BAR);
  1501.             this._lastVolumePos = this.controls[mx.video.UIManager.VOLUME_BAR].percentage;
  1502.             this._vc.removeEventListener("volumeUpdate",this);
  1503.             this._volumeBarIntervalID = setInterval(this,"volumeBarListener",this._volumeBarInterval,false);
  1504.             this.startHandleDrag(mx.video.UIManager.VOLUME_BAR,mx.video.UIManager.VOLUME_BAR_HANDLE);
  1505.             break;
  1506.          case mx.video.UIManager.BACK_BUTTON:
  1507.             this._vc.seekToPrevNavCuePoint();
  1508.             break;
  1509.          case mx.video.UIManager.FORWARD_BUTTON:
  1510.             this._vc.seekToNextNavCuePoint();
  1511.             break;
  1512.          case mx.video.UIManager.MUTE_ON_BUTTON:
  1513.          case mx.video.UIManager.MUTE_OFF_BUTTON:
  1514.             if(!this._isMuted)
  1515.             {
  1516.                this._isMuted = true;
  1517.                this.cachedSoundLevel = this._vc.volume;
  1518.                this._vc.volume = 0;
  1519.             }
  1520.             else
  1521.             {
  1522.                this._isMuted = false;
  1523.                this._vc.volume = this.cachedSoundLevel;
  1524.             }
  1525.             this.setEnabledAndVisibleForState(mx.video.UIManager.MUTE_OFF_BUTTON,mx.video.FLVPlayback.PLAYING);
  1526.             this.skinButtonControl(this.controls[mx.video.UIManager.MUTE_OFF_BUTTON]);
  1527.             this.setEnabledAndVisibleForState(mx.video.UIManager.MUTE_ON_BUTTON,mx.video.FLVPlayback.PLAYING);
  1528.             this.skinButtonControl(this.controls[mx.video.UIManager.MUTE_ON_BUTTON]);
  1529.             break;
  1530.          default:
  1531.             throw new Error("Unknown ButtonControl");
  1532.       }
  1533.       this._vc.activeVideoPlayerIndex = _loc2_;
  1534.    }
  1535.    function setEnabledAndVisibleForState(index, state)
  1536.    {
  1537.       var _loc5_ = this._vc.activeVideoPlayerIndex;
  1538.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1539.       var _loc3_ = state;
  1540.       if(_loc3_ == mx.video.FLVPlayback.BUFFERING && !this._bufferingOn)
  1541.       {
  1542.          _loc3_ = mx.video.FLVPlayback.PLAYING;
  1543.       }
  1544.       switch(index)
  1545.       {
  1546.          case mx.video.UIManager.VOLUME_BAR:
  1547.          case mx.video.UIManager.VOLUME_BAR_HANDLE:
  1548.             this.controls[index].myEnabled = true;
  1549.             this.controls[index].enabled = this._controlsEnabled;
  1550.             break;
  1551.          case mx.video.UIManager.MUTE_ON_BUTTON:
  1552.             this.controls[index].myEnabled = !this._isMuted;
  1553.             if(this.controls[mx.video.UIManager.MUTE_BUTTON] != undefined)
  1554.             {
  1555.                this.controls[index]._visible = this.controls[index].myEnabled;
  1556.             }
  1557.             break;
  1558.          case mx.video.UIManager.MUTE_OFF_BUTTON:
  1559.             this.controls[index].myEnabled = this._isMuted;
  1560.             if(this.controls[mx.video.UIManager.MUTE_BUTTON] != undefined)
  1561.             {
  1562.                this.controls[index]._visible = this.controls[index].myEnabled;
  1563.             }
  1564.             break;
  1565.          default:
  1566.             switch(_loc3_)
  1567.             {
  1568.                case mx.video.FLVPlayback.LOADING:
  1569.                case mx.video.FLVPlayback.CONNECTION_ERROR:
  1570.                   this.controls[index].myEnabled = false;
  1571.                   break;
  1572.                case mx.video.FLVPlayback.DISCONNECTED:
  1573.                   this.controls[index].myEnabled = this._vc.contentPath != undefined;
  1574.                   break;
  1575.                case mx.video.FLVPlayback.SEEKING:
  1576.                   break;
  1577.                default:
  1578.                   this.controls[index].myEnabled = true;
  1579.             }
  1580.       }
  1581.       switch(index)
  1582.       {
  1583.          case mx.video.UIManager.SEEK_BAR:
  1584.             switch(_loc3_)
  1585.             {
  1586.                case mx.video.FLVPlayback.STOPPED:
  1587.                case mx.video.FLVPlayback.PLAYING:
  1588.                case mx.video.FLVPlayback.PAUSED:
  1589.                case mx.video.FLVPlayback.REWINDING:
  1590.                case mx.video.FLVPlayback.SEEKING:
  1591.                   this.controls[index].myEnabled = true;
  1592.                   break;
  1593.                case mx.video.FLVPlayback.BUFFERING:
  1594.                   this.controls[index].myEnabled = !this._bufferingBarHides || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined;
  1595.                   break;
  1596.                default:
  1597.                   this.controls[index].myEnabled = false;
  1598.             }
  1599.             if(this.controls[index].myEnabled)
  1600.             {
  1601.                this.controls[index].myEnabled = !isNaN(this._vc.totalTime) && this._vc.totalTime > 0;
  1602.             }
  1603.             this.controls[index].handle_mc.myEnabled = this.controls[index].myEnabled;
  1604.             this.controls[index].handle_mc.enabled = this.controls[index].handle_mc.myEnabled;
  1605.             this.controls[index].handle_mc._visible = this.controls[index].myEnabled;
  1606.             var _loc4_ = !this._bufferingBarHides || this.controls[index].myEnabled || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined || !this.controls[mx.video.UIManager.BUFFERING_BAR]._visible;
  1607.             this.controls[index]._visible = _loc4_;
  1608.             this.controls[index].progress_mc._visible = _loc4_;
  1609.             this.controls[index].progress_mc.fill_mc._visible = _loc4_;
  1610.             this.controls[index].fullness_mc._visible = _loc4_;
  1611.             this.controls[index].progress_mc.fill_mc._visible = _loc4_;
  1612.             break;
  1613.          case mx.video.UIManager.BUFFERING_BAR:
  1614.             switch(_loc3_)
  1615.             {
  1616.                case mx.video.FLVPlayback.STOPPED:
  1617.                case mx.video.FLVPlayback.PLAYING:
  1618.                case mx.video.FLVPlayback.PAUSED:
  1619.                case mx.video.FLVPlayback.REWINDING:
  1620.                case mx.video.FLVPlayback.SEEKING:
  1621.                   this.controls[index].myEnabled = false;
  1622.                   break;
  1623.                default:
  1624.                   this.controls[index].myEnabled = true;
  1625.             }
  1626.             this.controls[index]._visible = this.controls[index].myEnabled;
  1627.             this.controls[index].fill_mc._visible = this.controls[index].myEnabled;
  1628.             break;
  1629.          case mx.video.UIManager.PAUSE_BUTTON:
  1630.             switch(_loc3_)
  1631.             {
  1632.                case mx.video.FLVPlayback.DISCONNECTED:
  1633.                case mx.video.FLVPlayback.STOPPED:
  1634.                case mx.video.FLVPlayback.PAUSED:
  1635.                case mx.video.FLVPlayback.REWINDING:
  1636.                   this.controls[index].myEnabled = false;
  1637.                   break;
  1638.                case mx.video.FLVPlayback.PLAYING:
  1639.                   this.controls[index].myEnabled = true;
  1640.                   break;
  1641.                case mx.video.FLVPlayback.BUFFERING:
  1642.                   this.controls[index].myEnabled = !this._bufferingBarHides || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined;
  1643.             }
  1644.             if(this.controls[mx.video.UIManager.PLAY_PAUSE_BUTTON] != undefined)
  1645.             {
  1646.                this.controls[index]._visible = this.controls[index].myEnabled;
  1647.             }
  1648.             break;
  1649.          case mx.video.UIManager.PLAY_BUTTON:
  1650.             switch(_loc3_)
  1651.             {
  1652.                case mx.video.FLVPlayback.PLAYING:
  1653.                   this.controls[index].myEnabled = false;
  1654.                   break;
  1655.                case mx.video.FLVPlayback.STOPPED:
  1656.                case mx.video.FLVPlayback.PAUSED:
  1657.                   this.controls[index].myEnabled = true;
  1658.                   break;
  1659.                case mx.video.FLVPlayback.BUFFERING:
  1660.                   this.controls[index].myEnabled = !this._bufferingBarHides || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined;
  1661.             }
  1662.             if(this.controls[mx.video.UIManager.PLAY_PAUSE_BUTTON] != undefined)
  1663.             {
  1664.                this.controls[index]._visible = !this.controls[mx.video.UIManager.PAUSE_BUTTON]._visible;
  1665.             }
  1666.             break;
  1667.          case mx.video.UIManager.STOP_BUTTON:
  1668.             switch(_loc3_)
  1669.             {
  1670.                case mx.video.FLVPlayback.DISCONNECTED:
  1671.                case mx.video.FLVPlayback.STOPPED:
  1672.                   this.controls[index].myEnabled = false;
  1673.                   break;
  1674.                case mx.video.FLVPlayback.PAUSED:
  1675.                case mx.video.FLVPlayback.PLAYING:
  1676.                case mx.video.FLVPlayback.BUFFERING:
  1677.                   this.controls[index].myEnabled = true;
  1678.             }
  1679.             break;
  1680.          case mx.video.UIManager.BACK_BUTTON:
  1681.          case mx.video.UIManager.FORWARD_BUTTON:
  1682.             if(_loc3_ !== mx.video.FLVPlayback.BUFFERING)
  1683.             {
  1684.                break;
  1685.             }
  1686.             this.controls[index].myEnabled = !this._bufferingBarHides || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined;
  1687.             break;
  1688.       }
  1689.       this.controls[index].enabled = this._controlsEnabled && this.controls[index].myEnabled;
  1690.       this._vc.activeVideoPlayerIndex = _loc5_;
  1691.    }
  1692.    function setupSkinAutoHide()
  1693.    {
  1694.       var _loc2_ = this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex);
  1695.       if(this._skinAutoHide && this.skin_mc != undefined)
  1696.       {
  1697.          this.skinAutoHideHitTest();
  1698.          if(this._skinAutoHideIntervalID == 0)
  1699.          {
  1700.             this._skinAutoHideIntervalID = setInterval(this,"skinAutoHideHitTest",mx.video.UIManager.SKIN_AUTO_HIDE_INTERVAL);
  1701.          }
  1702.       }
  1703.       else
  1704.       {
  1705.          this.skin_mc._visible = this.__visible;
  1706.          clearInterval(this._skinAutoHideIntervalID);
  1707.          this._skinAutoHideIntervalID = 0;
  1708.       }
  1709.    }
  1710.    function skinAutoHideHitTest()
  1711.    {
  1712.       if(!this.__visible)
  1713.       {
  1714.          this.skin_mc._visible = false;
  1715.       }
  1716.       else
  1717.       {
  1718.          var _loc4_ = this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex);
  1719.          var _loc3_ = _loc4_.hitTest(_root._xmouse,_root._ymouse,true);
  1720.          if(!_loc3_ && this.border_mc != undefined)
  1721.          {
  1722.             _loc3_ = this.border_mc.hitTest(_root._xmouse,_root._ymouse,true);
  1723.          }
  1724.          this.skin_mc._visible = _loc3_;
  1725.       }
  1726.    }
  1727. }
  1728.