1 /** 2 * com.sekati.display.LiquidXClip 3 * @version 1.0.5 4 * @author jason m horwitz | sekati.com | tendercreative.com 5 * Copyright (C) 2007 jason m horwitz, Sekat LLC. All Rights Reserved. 6 * Released under the MIT License: http://www.opensource.org/licenses/mit-license.php 7 */ 8 9 import com.sekati.display.LiquidClip; 10 import com.sekati.math.MathBase; 11 12 /** 13 * LiquidXClip - maintain a right-aligned clip positioning. 14 */ 15 class com.sekati.display.LiquidXClip extends LiquidClip { 16 17 private var _liquid:MovieClip; 18 private var _xoffset:Number; 19 private var _xmin:Number; 20 21 /** 22 * Constructor 23 */ 24 public function LiquidXClip() { 25 super( ); 26 _liquid = _this; 27 _xoffset = 0; 28 _xmin = 0; 29 } 30 31 /** 32 * Position ({@code _liquid = this; // default can be overriden by subclass}) right taking into account {@code _xoffset, _xmin}. 33 * @return Void 34 */ 35 private function _onResize():Void { 36 _liquid._x = MathBase.constrain( int( Stage.width - _liquid._width - _xoffset ), _xmin, Stage.width ); 37 } 38 }