- Timestamp:
- 01/07/10 14:58:01 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/fl5/src/com/longtailvideo/jwplayer/view/components/ComponentButton.as
r616 r771 10 10 protected var _background:DisplayObject; 11 11 protected var _clickFunction:Function; 12 protected var _clickLayer:Sprite;13 12 protected var _imageLayer:Sprite; 14 13 protected var _outColor:Color; … … 22 21 23 22 24 public function init ():void {23 public function init():void { 25 24 if (_background) { 26 25 nameDisplayObject("backgroundLayer", _background); … … 41 40 42 41 43 protected function outHandler (event:MouseEvent):void {42 protected function outHandler(event:MouseEvent):void { 44 43 if (_overIcon) { 45 44 if (_imageLayer.contains(_overIcon)) { … … 51 50 52 51 53 protected function overHandler (event:MouseEvent):void {52 protected function overHandler(event:MouseEvent):void { 54 53 if (_overIcon) { 55 54 if (_imageLayer.contains(_outIcon)) { … … 62 61 63 62 /** Handles mouse clicks **/ 64 protected function clickHandler (event:MouseEvent):void {63 protected function clickHandler(event:MouseEvent):void { 65 64 try { 66 65 _clickFunction(event); … … 76 75 * @param dpo The new caption for the button. 77 76 **/ 78 protected function setImage (dpo:DisplayObject):void {77 protected function setImage(dpo:DisplayObject):void { 79 78 if (dpo) { 80 79 if (_imageLayer.contains(dpo)) { … … 87 86 88 87 89 public function setBackground (background:DisplayObject = null):void {88 public function setBackground(background:DisplayObject = null):void { 90 89 if (background) { 91 90 _background = background; 92 updateClickLayer();93 91 } 94 92 } 95 93 96 94 97 public function setOutIcon (outIcon:DisplayObject = null):void {95 public function setOutIcon(outIcon:DisplayObject = null):void { 98 96 if (outIcon) { 99 97 _outIcon = outIcon; … … 102 100 103 101 104 public function setOverIcon (overIcon:DisplayObject = null):void {102 public function setOverIcon(overIcon:DisplayObject = null):void { 105 103 if (overIcon) { 106 104 _overIcon = overIcon; 107 105 } 108 106 } 109 public function resize (width:Number, height:Number):void {107 public function resize(width:Number, height:Number):void { 110 108 } 111 109 112 110 113 protected function centerIcon (icon:DisplayObject):void {111 protected function centerIcon(icon:DisplayObject):void { 114 112 if (icon) { 115 113 if (_background) { … … 124 122 125 123 126 protected function updateClickLayer ():void { 127 if (_clickLayer && contains(_clickLayer)) { 128 removeChild(_clickLayer); 129 } 130 /*_clickLayer = Draw.clone(_background as Sprite) as Sprite; 131 var overTransform:ColorTransform = new ColorTransform() 132 overTransform.color = 0; 133 _clickLayer.transform.colorTransform = overTransform; 134 _clickLayer.alpha = 1; 135 _clickLayer.name = "clickLayer"; 136 addChild(_clickLayer); 137 _clickLayer.addEventListener(MouseEvent.MOUSE_OVER, tempHandler);*/ 138 } 139 140 141 public function set outColor (outColor:Color):void { 124 public function set outColor(outColor:Color):void { 142 125 _outColor = outColor; 143 126 } 144 127 145 128 146 public function set overColor (overColor:Color):void {129 public function set overColor(overColor:Color):void { 147 130 _overColor = overColor; 148 131 } 149 132 150 133 151 public function set clickFunction (clickFunction:Function):void {134 public function set clickFunction(clickFunction:Function):void { 152 135 _clickFunction = clickFunction 153 136 } 154 137 155 138 156 private function nameDisplayObject (name:String, displayObject:DisplayObject):void {139 private function nameDisplayObject(name:String, displayObject:DisplayObject):void { 157 140 try { 158 141 displayObject.name = name;
Note: See TracChangeset
for help on using the changeset viewer.
