home *** CD-ROM | disk | FTP | other *** search
/ Canadian Forces: A World of Opportunities / CanadianForces-AWorldOfOpportunities-WinMac.bin / 02_JobsNavy.swf / scripts / __Packages / mx / video / UIManager.as < prev    next >
Text File  |  2006-07-25  |  60KB  |  1,694 lines

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