home *** CD-ROM | disk | FTP | other *** search
/ csi.uticak12.org / csi.uticak12.org.tar / csi.uticak12.org / flashVideo / Handshake.swf / scripts / __Packages / mx / video / UIManager.as < prev    next >
Text File  |  2010-12-15  |  60KB  |  1,697 lines

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