home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2012 April / ME_04_2012.iso / Video-Tutorial / iPhoto / media / player.swf / scripts / FloatingTOCMedia.as < prev   
Encoding:
Text File  |  2011-11-11  |  26.3 KB  |  821 lines

  1. package
  2. {
  3.    import com.adobe.xmp.core.XMPMeta;
  4.    import com.brooksandrus.events.CaptionEvent;
  5.    import com.brooksandrus.events.VideoMetadataEvent;
  6.    import com.brooksandrus.events.VideoStreamEvent;
  7.    import com.brooksandrus.player.MediaPlayer;
  8.    import com.brooksandrus.player.XMPData;
  9.    import com.techsmith.events.LockTocEvent;
  10.    import com.techsmith.events.RequestBinaryImageEvent;
  11.    import com.techsmith.ui.FloatingToc;
  12.    import com.techsmith.utils.URLBinaryStream;
  13.    import flash.accessibility.*;
  14.    import flash.debugger.*;
  15.    import flash.display.*;
  16.    import flash.errors.*;
  17.    import flash.events.*;
  18.    import flash.external.*;
  19.    import flash.filters.*;
  20.    import flash.geom.*;
  21.    import flash.media.*;
  22.    import flash.net.*;
  23.    import flash.printing.*;
  24.    import flash.profiler.*;
  25.    import flash.system.*;
  26.    import flash.text.*;
  27.    import flash.ui.*;
  28.    import flash.utils.*;
  29.    import flash.xml.*;
  30.    import mx.binding.*;
  31.    import mx.containers.Canvas;
  32.    import mx.core.IFlexModuleFactory;
  33.    import mx.core.UIComponentDescriptor;
  34.    import mx.effects.Tween;
  35.    import mx.events.DragEvent;
  36.    import mx.events.FlexEvent;
  37.    import mx.events.ListEvent;
  38.    import mx.events.PropertyChangeEvent;
  39.    import mx.events.TweenEvent;
  40.    import mx.styles.*;
  41.    
  42.    public class FloatingTOCMedia extends Canvas
  43.    {
  44.       private var _103772132media:MediaPlayer;
  45.       
  46.       private var _3568542tree:FloatingToc;
  47.       
  48.       private var _documentDescriptor_:UIComponentDescriptor = new UIComponentDescriptor({
  49.          "type":Canvas,
  50.          "stylesFactory":function():void
  51.          {
  52.             this.backgroundColor = 0;
  53.          },
  54.          "propertiesFactory":function():Object
  55.          {
  56.             return {
  57.                "height":450,
  58.                "width":960,
  59.                "childDescriptors":[new UIComponentDescriptor({
  60.                   "type":MediaPlayer,
  61.                   "id":"media",
  62.                   "propertiesFactory":function():Object
  63.                   {
  64.                      return {"dockingtoc":true};
  65.                   }
  66.                }),new UIComponentDescriptor({
  67.                   "type":FloatingToc,
  68.                   "id":"tree",
  69.                   "events":{"creationComplete":"__tree_creationComplete"},
  70.                   "propertiesFactory":function():Object
  71.                   {
  72.                      return {
  73.                         "height":300,
  74.                         "width":230,
  75.                         "x":-230,
  76.                         "y":0
  77.                      };
  78.                   }
  79.                })]
  80.             };
  81.          }
  82.       });
  83.       
  84.       private var __moduleFactoryInitialized:Boolean = false;
  85.       
  86.       private var xmpData:XMPData = null;
  87.       
  88.       private var iStream:URLBinaryStream = null;
  89.       
  90.       private var dock:String = "left";
  91.       
  92.       private var dragging:Boolean = false;
  93.       
  94.       private var sliding:Boolean = false;
  95.       
  96.       private var slidingIn:Boolean = false;
  97.       
  98.       private var slidingOut:Boolean = false;
  99.       
  100.       private var tocHidden:Boolean = true;
  101.       
  102.       private var isTyping:Boolean = false;
  103.       
  104.       private var tween:Tween;
  105.       
  106.       private var tween2:Tween;
  107.       
  108.       private var treepos:Number = -230;
  109.       
  110.       private var mediapos:Number = 0;
  111.       
  112.       private var videoActive:Boolean;
  113.       
  114.       private var delayTimer:Timer;
  115.       
  116.       private var mouseTimer:Timer;
  117.       
  118.       private var funcx:Function = null;
  119.       
  120.       private var fullscreenTimer:Timer;
  121.       
  122.       private var _mouseHide:Boolean = false;
  123.       
  124.       private var _tocklock:Boolean = false;
  125.       
  126.       private var showToc:Boolean;
  127.       
  128.       private var lastunscaledWidth:Number;
  129.       
  130.       private var lastunscaledHeight:Number;
  131.       
  132.       public function FloatingTOCMedia()
  133.       {
  134.          super();
  135.          mx_internal::_document = this;
  136.          this.height = 450;
  137.          this.horizontalScrollPolicy = "off";
  138.          this.verticalScrollPolicy = "off";
  139.          this.width = 960;
  140.       }
  141.       
  142.       override public function set moduleFactory(param1:IFlexModuleFactory) : void
  143.       {
  144.          var factory:IFlexModuleFactory = param1;
  145.          super.moduleFactory = factory;
  146.          if(this.__moduleFactoryInitialized)
  147.          {
  148.             return;
  149.          }
  150.          this.__moduleFactoryInitialized = true;
  151.          if(!this.styleDeclaration)
  152.          {
  153.             this.styleDeclaration = new CSSStyleDeclaration(null,styleManager);
  154.          }
  155.          this.styleDeclaration.defaultFactory = function():void
  156.          {
  157.             this.backgroundColor = 0;
  158.          };
  159.       }
  160.       
  161.       override public function initialize() : void
  162.       {
  163.          mx_internal::setDocumentDescriptor(this._documentDescriptor_);
  164.          super.initialize();
  165.       }
  166.       
  167.       public function init(param1:XMPMeta) : void
  168.       {
  169.          var xmp:XMPMeta = param1;
  170.          this.xmpData = new XMPData(xmp);
  171.          this.showToc = this.media.config.showToc;
  172.          this.delayTimer = new Timer(700,1);
  173.          this.mouseTimer = new Timer(3000,1);
  174.          this.mouseTimer.addEventListener(TimerEvent.TIMER_COMPLETE,this.slideOutTOCTimer);
  175.          if(xmp == null)
  176.          {
  177.             this.showToc = false;
  178.          }
  179.          if(!this.showToc)
  180.          {
  181.             this.tree.visible = false;
  182.             this._tocklock = true;
  183.          }
  184.          else
  185.          {
  186.             this.setTocPosition(this.media.config.tocType);
  187.             if(this.xmpData.title != null)
  188.             {
  189.                this.tree.title = this.xmpData.title;
  190.             }
  191.             if(this.xmpData.toc != null)
  192.             {
  193.                if(this.xmpData.tocimage != null)
  194.                {
  195.                   this.tree.tocImage(this.xmpData.tocimage);
  196.                }
  197.                this.tree.dataProvider = this.xmpData.toc.children();
  198.                this.tree.validateNow();
  199.                this.tree.expandChildrenOf(0,true);
  200.             }
  201.             else if(!this.media.config.showSearch || this.xmpData.searchData.length == 0)
  202.             {
  203.                this.showToc = false;
  204.                this.tree.visible = false;
  205.                this._tocklock = true;
  206.             }
  207.             if(this.media.config.showSearch && this.xmpData.searchData.length >= 0)
  208.             {
  209.                this.tree.searchData = this.xmpData.searchData;
  210.                this.tree.setLocalizedTocText(this.xmpData.getLocalizedText("x-default"));
  211.             }
  212.             if(this.xmpData.captions != null)
  213.             {
  214.                this.media.initiateCaptions(this.xmpData.captions);
  215.                if(ExternalInterface.available)
  216.                {
  217.                   try
  218.                   {
  219.                      ExternalInterface.call("hasCaptions");
  220.                   }
  221.                   catch(e:Error)
  222.                   {
  223.                   }
  224.                }
  225.             }
  226.             if(this.xmpData.hotspots != null)
  227.             {
  228.                this.media.initiateHS(this.xmpData.hotspots);
  229.             }
  230.             if(this.showToc)
  231.             {
  232.                this.tree.setColor(this.media.config.colorObj);
  233.                this.tree.validateNow();
  234.             }
  235.          }
  236.          if(this.showToc)
  237.          {
  238.             this.tree.addEventListener(RequestBinaryImageEvent.BYTE_REQUEST,this.getbinaryImage);
  239.             this.tree.addEventListener(KeyboardEvent.KEY_DOWN,this.isTypingHandler);
  240.          }
  241.          if(String(this.xmpData.groupthumbs) != "null")
  242.          {
  243.             this.iStream = new URLBinaryStream(this.xmpData.groupthumbs);
  244.          }
  245.          this.media.setLocalizedText(this.xmpData.getLocalizedText("x-default"));
  246.          this.media.addEventListener(VideoStreamEvent.STARTED,this.playbackStartedHandler,false,0,true);
  247.          this.media.addEventListener(FullScreenEvent.FULL_SCREEN,this.fullscreenHandler);
  248.          this.media.addEventListener(CaptionEvent.CAPTIONS_LANG_CHANGE,this.captionChangeHandler);
  249.       }
  250.       
  251.       private function captionChangeHandler(param1:CaptionEvent) : void
  252.       {
  253.          if(this.media.config.showSearch && this.xmpData.searchwithCaptionData(param1.lang).length >= 0)
  254.          {
  255.             this.tree.searchData = this.xmpData.searchwithCaptionData(param1.lang);
  256.             this.tree.setLocalizedTocText(this.xmpData.getLocalizedText(param1.lang));
  257.             this.media.setLocalizedText(this.xmpData.getLocalizedText(param1.lang));
  258.          }
  259.       }
  260.       
  261.       private function isTypingHandler(param1:KeyboardEvent) : void
  262.       {
  263.          this.isTyping = true;
  264.          this.delayFunction(8000,this.funcx);
  265.       }
  266.       
  267.       private function getbinaryImage(param1:RequestBinaryImageEvent) : void
  268.       {
  269.          var _loc2_:ByteArray = this.iStream.getBytesArray(param1.offset);
  270.          param1.target.ByteLoader(_loc2_,param1.offset,param1.uid);
  271.       }
  272.       
  273.       private function fullscreenHandler(param1:FullScreenEvent) : void
  274.       {
  275.          if(param1.fullScreen)
  276.          {
  277.             this.setfullscreenMouseTimer();
  278.             this.addEventListener(MouseEvent.MOUSE_MOVE,this.fullscreenMouseMoveHandler);
  279.          }
  280.          else
  281.          {
  282.             Mouse.show();
  283.             this.mouseTimer.stop();
  284.             this.mouseTimer.reset();
  285.             this.removeEventListener(MouseEvent.MOUSE_MOVE,this.fullscreenMouseMoveHandler);
  286.          }
  287.          if(this.showToc)
  288.          {
  289.             this.tree.fullscreen(param1.fullScreen);
  290.          }
  291.       }
  292.       
  293.       private function fullscreenMouseMoveHandler(param1:MouseEvent) : void
  294.       {
  295.          if(this._mouseHide)
  296.          {
  297.             this._mouseHide = false;
  298.             Mouse.show();
  299.          }
  300.          this.delayFunction(300,this.delayHandlerIN);
  301.          this.setfullscreenMouseTimer();
  302.       }
  303.       
  304.       private function setfullscreenMouseTimer() : void
  305.       {
  306.          this.mouseTimer.stop();
  307.          this.mouseTimer.reset();
  308.          this.mouseTimer.start();
  309.       }
  310.       
  311.       private function slideOutTOCTimer(param1:TimerEvent) : void
  312.       {
  313.          this.delayFunction(600,this.delayHandlerOUT);
  314.          Mouse.hide();
  315.          this._mouseHide = true;
  316.       }
  317.       
  318.       private function setTocPosition(param1:String) : void
  319.       {
  320.          if(param1 == "l")
  321.          {
  322.             this.tree.x = -230;
  323.             this.dock = "left";
  324.          }
  325.          if(param1 == "r")
  326.          {
  327.             this.dock = "right";
  328.             this.tree.x = unscaledWidth;
  329.             this.treepos = this.tree.x;
  330.             this.mediapos = 0;
  331.          }
  332.          if(param1 == "f")
  333.          {
  334.             this.dock = "float";
  335.             this.tree.x = (unscaledWidth - this.tree.width) / 3;
  336.             this.tree.y = (unscaledHeight - (400 + this.media.controls.height)) / 2;
  337.             this.treepos = 0;
  338.             if(this.media.config.showStartScreen)
  339.             {
  340.                this.tree.visible = false;
  341.             }
  342.          }
  343.          this.tree.docktype = this.dock;
  344.       }
  345.       
  346.       private function itemClickHandler(param1:ListEvent) : void
  347.       {
  348.          var metaHandler:Function;
  349.          var time:Number = NaN;
  350.          var e:ListEvent = param1;
  351.          var item:XML = e.itemRenderer.data as XML;
  352.          var milliseconds:int = parseInt(item.@startTime);
  353.          time = milliseconds / 1000;
  354.          if(!this.media.loaded)
  355.          {
  356.             metaHandler = function():void
  357.             {
  358.                media.replayfromToc(time);
  359.             };
  360.             this.media.addEventListener(VideoMetadataEvent.VIDEO_METADATA,metaHandler,false,0,true);
  361.             this.media.play();
  362.          }
  363.          else
  364.          {
  365.             this.media.replayfromToc(time,true);
  366.          }
  367.       }
  368.       
  369.       private function registerlisteners() : void
  370.       {
  371.          this.addEventListener(MouseEvent.ROLL_OVER,this.mouseOverHandler,false,0,false);
  372.          this.addEventListener(MouseEvent.ROLL_OUT,this.mouseOutHandler,false,0,false);
  373.          this.tree.addEventListener(DragEvent.DRAG_START,this.dragstart);
  374.          this.tree.addEventListener(DragEvent.DRAG_COMPLETE,this.dragstop);
  375.          this.tree.addEventListener(ListEvent.ITEM_CLICK,this.itemClickHandler);
  376.          this.tree.addEventListener(LockTocEvent.TOC_LOCK,this.tockLockHandler);
  377.       }
  378.       
  379.       private function dragstart(param1:DragEvent) : void
  380.       {
  381.          this.dragging = true;
  382.          this.dock = "float";
  383.          this.tree.startDrag();
  384.          this.tree.height = 400;
  385.          this.tree.docktype = this.dock;
  386.          this.invalidateDisplayList();
  387.       }
  388.       
  389.       private function dragstop(param1:DragEvent) : void
  390.       {
  391.          this.tree.stopDrag();
  392.          this.dragging = false;
  393.          this.dragEnterFrame(new Event(Event.COMPLETE));
  394.          this.tree.docktype = this.dock;
  395.          invalidateDisplayList();
  396.       }
  397.       
  398.       private function dragEnterFrame(param1:Event) : void
  399.       {
  400.          if(this.tree.x <= 7)
  401.          {
  402.             this.dock = "left";
  403.             this.treepos = 0;
  404.             this.mediapos = this.tree.width;
  405.          }
  406.          if(this.tree.x >= this.width - (7 + this.tree.width))
  407.          {
  408.             this.dock = "right";
  409.             this.treepos = this.unscaledWidth - 230;
  410.             if(this.mediapos == 0)
  411.             {
  412.                this.mediapos = this.unscaledWidth - this.treepos;
  413.             }
  414.          }
  415.          if(this.tree.x > 7 && this.tree.x < this.width - (7 + this.tree.width))
  416.          {
  417.             this.dock = "float";
  418.          }
  419.       }
  420.       
  421.       private function playbackStartedHandler(param1:Event) : void
  422.       {
  423.          this.videoActive = true;
  424.          if(this.showToc == false)
  425.          {
  426.             this.slideInTOC();
  427.          }
  428.          else
  429.          {
  430.             this.delayFunction(1000,this.delayHandlerIN);
  431.          }
  432.       }
  433.       
  434.       private function replayHandler(param1:Event) : void
  435.       {
  436.          var _loc2_:Boolean = false;
  437.          this.videoActive = true;
  438.          if(this.showToc)
  439.          {
  440.             _loc2_ = this._tocklock;
  441.             this._tocklock = false;
  442.             this.slideInTOC();
  443.             this._tocklock = _loc2_;
  444.          }
  445.       }
  446.       
  447.       private function playbackFinishedHandler(param1:VideoStreamEvent) : void
  448.       {
  449.          var _loc2_:Boolean = false;
  450.          if(this.media.config.showEndScreen)
  451.          {
  452.             _loc2_ = this._tocklock;
  453.             this._tocklock = false;
  454.             this.slideOutTOC();
  455.             this._tocklock = _loc2_;
  456.             this.videoActive = false;
  457.          }
  458.       }
  459.       
  460.       private function delayFunction(param1:Number, param2:Function) : void
  461.       {
  462.          if(this.funcx !== null)
  463.          {
  464.             this.delayTimer.removeEventListener(TimerEvent.TIMER_COMPLETE,this.funcx);
  465.          }
  466.          this.delayTimer.delay = param1;
  467.          this.funcx = param2;
  468.          this.delayTimer.stop();
  469.          this.delayTimer.reset();
  470.          this.delayTimer.addEventListener(TimerEvent.TIMER_COMPLETE,param2);
  471.          this.delayTimer.start();
  472.       }
  473.       
  474.       private function tockLockHandler(param1:LockTocEvent) : void
  475.       {
  476.          this._tocklock = param1.selected;
  477.       }
  478.       
  479.       private function delayHandlerIN(param1:TimerEvent) : void
  480.       {
  481.          this.slideInTOC();
  482.          if(this.dragging)
  483.          {
  484.             this.dragstop(new DragEvent(DragEvent.DRAG_COMPLETE));
  485.             invalidateDisplayList();
  486.          }
  487.       }
  488.       
  489.       private function delayHandlerOUT(param1:TimerEvent) : void
  490.       {
  491.          if(this.dragging)
  492.          {
  493.             this.dragstop(new DragEvent(DragEvent.DRAG_COMPLETE));
  494.             invalidateDisplayList();
  495.          }
  496.          this.delayFunction(250,this.delayTocSlideOut);
  497.       }
  498.       
  499.       private function delayTocSlideOut(param1:TimerEvent) : void
  500.       {
  501.          this.slideOutTOC();
  502.       }
  503.       
  504.       private function delayHandlerEndscreen(param1:TimerEvent) : void
  505.       {
  506.          var _loc2_:Boolean = this._tocklock;
  507.          this.slideOutTOC();
  508.          if(this.dragging)
  509.          {
  510.             this.dragstop(new DragEvent(DragEvent.DRAG_COMPLETE));
  511.             invalidateDisplayList();
  512.          }
  513.          this.videoActive = false;
  514.       }
  515.       
  516.       private function mouseOverHandler(param1:MouseEvent) : void
  517.       {
  518.          if(this.showToc == false)
  519.          {
  520.             this.slideInTOC();
  521.          }
  522.          else
  523.          {
  524.             this.delayFunction(600,this.delayHandlerIN);
  525.          }
  526.          if(this.dragging)
  527.          {
  528.             this.tree.stopDrag();
  529.          }
  530.       }
  531.       
  532.       private function mouseOutHandler(param1:MouseEvent) : void
  533.       {
  534.          if(this.showToc == false)
  535.          {
  536.             this.slideOutTOC();
  537.          }
  538.          else if(this.isTyping)
  539.          {
  540.             this.delayFunction(8000,this.delayHandlerOUT);
  541.          }
  542.          else
  543.          {
  544.             this.delayFunction(600,this.delayHandlerOUT);
  545.          }
  546.          if(this.dragging)
  547.          {
  548.             this.tree.stopDrag();
  549.          }
  550.       }
  551.       
  552.       private function slideInTOC() : void
  553.       {
  554.          if(this.media.config.showStartScreen && !this.media.config.autoStart && !this.videoActive || this._tocklock)
  555.          {
  556.             if(this.showToc == false)
  557.             {
  558.                this.media.mouseOverHandler(new MouseEvent(MouseEvent.MOUSE_OVER));
  559.             }
  560.             return;
  561.          }
  562.          if(this.sliding)
  563.          {
  564.             this.tween.pause();
  565.          }
  566.          if(this.tween2)
  567.          {
  568.             this.tween2.pause();
  569.          }
  570.          if(this.dock == "left")
  571.          {
  572.             this.tween = new Tween(this,this.tree.x,0,900,60,this.slidingInLeftHandler,this.slidingInLeftEndHandler);
  573.             this.tween.easingFunction = this.easit;
  574.          }
  575.          if(this.dock == "right")
  576.          {
  577.             this.tween = new Tween(this,this.tree.x,this.unscaledWidth - this.tree.width,900,60,this.slidingInRightHandler,this.slidingInRightEndHandler);
  578.             this.tween.easingFunction = this.easit;
  579.          }
  580.          if(this.media.config.autoHide || this.dock == "float")
  581.          {
  582.             this.tween2 = new Tween(this,this.tree.alpha,1,500,60,this.fadeHandler,this.FadeEndHandler);
  583.          }
  584.       }
  585.       
  586.       private function slidingInLeftHandler(param1:Number) : void
  587.       {
  588.          this.sliding = true;
  589.          this.treepos = param1;
  590.          this.mediapos = this.treepos + 230;
  591.          this.invalidateDisplayList();
  592.       }
  593.       
  594.       private function slidingInLeftEndHandler(param1:Number) : void
  595.       {
  596.          this.treepos = param1;
  597.          this.mediapos = this.treepos + 230;
  598.          this.sliding = false;
  599.          this.invalidateDisplayList();
  600.          if(this.isTyping)
  601.          {
  602.             stage.focus = null;
  603.             this.isTyping = false;
  604.          }
  605.       }
  606.       
  607.       private function slidingInRightHandler(param1:Number) : void
  608.       {
  609.          this.sliding = true;
  610.          this.treepos = param1;
  611.          this.mediapos = this.unscaledWidth - param1;
  612.          this.invalidateDisplayList();
  613.       }
  614.       
  615.       private function slidingInRightEndHandler(param1:Number) : void
  616.       {
  617.          this.treepos = param1;
  618.          this.mediapos = this.unscaledWidth - param1;
  619.          this.sliding = false;
  620.          this.invalidateDisplayList();
  621.          if(this.isTyping)
  622.          {
  623.             stage.focus = null;
  624.             this.isTyping = false;
  625.          }
  626.       }
  627.       
  628.       public function easit(param1:Number, param2:Number, param3:Number, param4:Number) : Number
  629.       {
  630.          param1 = param1 / param4;
  631.          var _loc5_:Number = param1 * param1;
  632.          var _loc6_:Number = _loc5_ * param1;
  633.          return param2 + param3 * (6 * _loc6_ * _loc5_ + -15 * _loc5_ * _loc5_ + 10 * _loc6_ + 0 * _loc5_ + 0 * param1);
  634.       }
  635.       
  636.       private function slideOutTOC() : void
  637.       {
  638.          trace("slideOut");
  639.          if(this.media.config.showStartScreen && !this.media.config.autoStart && !this.videoActive || this._tocklock)
  640.          {
  641.             if(this.showToc == false)
  642.             {
  643.                this.media.mouseOutHandler(new MouseEvent(MouseEvent.MOUSE_OUT));
  644.             }
  645.             return;
  646.          }
  647.          if(this.sliding)
  648.          {
  649.             this.tween.pause();
  650.          }
  651.          if(this.tween2)
  652.          {
  653.             this.tween2.pause();
  654.          }
  655.          if(this.dock == "left")
  656.          {
  657.             this.tween = new Tween(this,this.tree.x,-this.tree.width,900,60,this.slidingInLeftHandler,this.slidingInLeftEndHandler);
  658.             this.tween.easingFunction = this.easit;
  659.          }
  660.          if(this.dock == "right")
  661.          {
  662.             this.tween = new Tween(this,this.tree.x,this.unscaledWidth,900,60,this.slidingInRightHandler,this.slidingInRightEndHandler);
  663.             this.tween.easingFunction = this.easit;
  664.          }
  665.          if(this.media.config.autoHide || this.dock == "float")
  666.          {
  667.             this.tween2 = new Tween(this,this.tree.alpha,0,500,60,this.fadeHandler,this.FadeEndHandler);
  668.          }
  669.       }
  670.       
  671.       private function fadeHandler(param1:Number) : void
  672.       {
  673.          this.tree.visible = true;
  674.          this.tree.alpha = param1;
  675.          if(this.media.config.autoHide)
  676.          {
  677.             this.media.controls.alpha = param1;
  678.          }
  679.          if(this.media.config.autoHide && this.media._hasClosedCaptions)
  680.          {
  681.             this.media._hideControls = true;
  682.             this.media.controls.y = this.media._controlYhide - this.media.controls.DEFAULT_MAX_HEIGHT * param1;
  683.             this.tree.yfoot = this.media.controls.DEFAULT_MAX_HEIGHT * param1;
  684.             this.media.moveUpdateHandler(new TweenEvent(TweenEvent.TWEEN_UPDATE));
  685.          }
  686.       }
  687.       
  688.       private function FadeEndHandler(param1:Number) : void
  689.       {
  690.          if(param1 < 1 && this.dock == "float")
  691.          {
  692.             this.tree.visible = false;
  693.          }
  694.          if(this.media.config.autoHide && this.media._hasClosedCaptions)
  695.          {
  696.             this.media._hideControls = true;
  697.             this.media.controls.y = this.media._controlYhide - this.media.controls.DEFAULT_MAX_HEIGHT * param1;
  698.             this.tree.yfoot = this.media.controls.DEFAULT_MAX_HEIGHT * param1;
  699.             this.media.moveUpdateHandler(new TweenEvent(TweenEvent.TWEEN_UPDATE));
  700.          }
  701.       }
  702.       
  703.       override protected function updateDisplayList(param1:Number, param2:Number) : void
  704.       {
  705.          setActualSize(param1,param2);
  706.          super.updateDisplayList(param1,param2);
  707.          if(this.dock == "left")
  708.          {
  709.             this.tree.y = 0;
  710.             this.tree.x = this.treepos + 1;
  711.             this.tree.height = param2;
  712.             this.media.x = this.mediapos;
  713.             this.media.width = param1 - this.mediapos;
  714.             this.media.height = param2;
  715.          }
  716.          if(this.dock == "right")
  717.          {
  718.             if(this.lastunscaledWidth != param1)
  719.             {
  720.                if(this.tween)
  721.                {
  722.                   this.tween.stop();
  723.                }
  724.                if(this._tocklock)
  725.                {
  726.                   this.treepos = param1 - this.tree.width;
  727.                   this.mediapos = param1 - this.treepos;
  728.                }
  729.                else
  730.                {
  731.                   this.treepos = param1;
  732.                   this.mediapos = param1 - this.treepos;
  733.                }
  734.             }
  735.             this.tree.y = 0;
  736.             this.tree.x = this.treepos;
  737.             this.tree.height = param2;
  738.             this.media.x = 0;
  739.             this.media.width = param1 - this.mediapos;
  740.             this.media.height = param2;
  741.          }
  742.          if(this.dock == "float")
  743.          {
  744.             this.media.x = 1;
  745.             this.media.width = param1 - 1;
  746.             this.media.height = param2;
  747.             this.tree.height = param2 - this.media.controls.height >= 400 ? 400 : param2 - this.media.controls.height;
  748.             if(this.tree.y >= param2 - (this.media.controls.height + this.tree.height))
  749.             {
  750.                this.tree.y = param2 - (this.media.controls.height + this.tree.height);
  751.             }
  752.             if(this.tree.y <= 0)
  753.             {
  754.                this.tree.y = 0;
  755.             }
  756.             if(this.lastunscaledWidth != param1 && this.tree.x + this.tree.width >= param1)
  757.             {
  758.                this.tree.x = param1 - (this.tree.width + 5);
  759.             }
  760.          }
  761.          if(this.lastunscaledHeight != param2)
  762.          {
  763.             if(this.media._hasClosedCaptions && !this._tocklock && this.media.config.autoHide)
  764.             {
  765.                this.media.controls.y = param2;
  766.             }
  767.             else
  768.             {
  769.                this.media.controls.y = param2 - this.media.controls.DEFAULT_MAX_HEIGHT;
  770.             }
  771.          }
  772.          this.lastunscaledWidth = param1;
  773.          this.lastunscaledHeight = param2;
  774.       }
  775.       
  776.       public function __tree_creationComplete(param1:FlexEvent) : void
  777.       {
  778.          this.registerlisteners();
  779.       }
  780.       
  781.       [Bindable(event="propertyChange")]
  782.       public function get media() : MediaPlayer
  783.       {
  784.          return this._103772132media;
  785.       }
  786.       
  787.       public function set media(param1:MediaPlayer) : void
  788.       {
  789.          var _loc2_:Object = this._103772132media;
  790.          if(_loc2_ !== param1)
  791.          {
  792.             this._103772132media = param1;
  793.             if(this.hasEventListener("propertyChange"))
  794.             {
  795.                this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"media",_loc2_,param1));
  796.             }
  797.          }
  798.       }
  799.       
  800.       [Bindable(event="propertyChange")]
  801.       public function get tree() : FloatingToc
  802.       {
  803.          return this._3568542tree;
  804.       }
  805.       
  806.       public function set tree(param1:FloatingToc) : void
  807.       {
  808.          var _loc2_:Object = this._3568542tree;
  809.          if(_loc2_ !== param1)
  810.          {
  811.             this._3568542tree = param1;
  812.             if(this.hasEventListener("propertyChange"))
  813.             {
  814.                this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"tree",_loc2_,param1));
  815.             }
  816.          }
  817.       }
  818.    }
  819. }
  820.  
  821.