Adobe Systems, Inc.

ScrollBarThumb.as

Go to the documentation of this file.
00001 /******************************************************************
00002 ** Copyright 2005-2006 Adobe Systems Incorporated
00003 ** Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004 ** or a copy at http://opensource.adobe.com/licenses.html)
00005 **
00006 ** ScrollBarThumb Class 
00007 ** 
00008 ** class to position scroll thumb end caps on the scroll bar since
00009 ** since I can't get scale9grid to work right on nested movieclips
00010 ********************************************************************/
00011 
00012 class amg.ScrollBarThumb extends MovieClip {
00013         private var cap1:MovieClip;
00014         private var middle:MovieClip;
00015         private var cap2:MovieClip;
00016         private var layout:String;
00017         
00018         //class constructor
00019         public function ScrollBarThumb() {
00020                 
00021         }
00022         
00023         public function init(p_layout:String){
00024                 switch (p_layout){
00025                         case "horizontal" :
00026                                 this.cap1 = this.attachMovie("ScrollThumbHorizEndCap","cap1",this.getNextHighestDepth());
00027                                 this.middle = this.attachMovie("ScrollThumbHorizMiddle","middle",this.getNextHighestDepth());
00028                                 this.cap2 = this.attachMovie("ScrollThumbHorizEndCap","cap2",this.getNextHighestDepth(),{_rotation:180});
00029                                 this.cap1._x = 0;
00030                                 this.middle._x = 1;
00031                                 break;
00032                         case "vertical" :
00033                                 this.cap1 = this.attachMovie("ScrollThumbEndCap","cap1",this.getNextHighestDepth());
00034                                 this.middle = this.attachMovie("ScrollThumbMiddle","middle",this.getNextHighestDepth());
00035                                 this.cap2 = this.attachMovie("ScrollThumbEndCap","cap2",this.getNextHighestDepth(),{_rotation:180});
00036                                 this.cap1._y = 0;
00037                                 this.middle._y = 1;
00038                                 break;
00039                 }
00040                 this.layout = p_layout;
00041                 
00042         }
00043         
00044         public function setHeight(p_height:Number){
00045                 this.middle._y = 1;
00046                 this.middle._height = p_height;
00047                 this.cap2._y = this.middle._y + this.middle._height + 1;
00048         }
00049         
00050         public function setWidth(p_width:Number){
00051                 this.middle._x = 1;
00052                 this.middle._width = p_width;
00053                 this.cap2._x = this.middle._x + this.middle._width + 1;
00054         }
00055         
00056 }

Copyright © 2006 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.